diff --git a/python/Makefile b/python/Makefile index f4f5d969f..d9ac8de19 100644 --- a/python/Makefile +++ b/python/Makefile @@ -199,6 +199,13 @@ endif $(call object_for,python/src/py/objmodule.c): SFLAGS += -DMP_QSTR_urandom="MP_QSTR_random" $(call object_for,python/src/extmod/modurandom.c): SFLAGS += -DMP_QSTR_urandom="MP_QSTR_random" +# Rename usys to sys +# In order to change the name of the micropython module 'usys' to 'usys' +# (without altering micropython files), we redefined the macro MP_QSTR_usys +# by DMP_QSTR_sys. +$(call object_for,python/src/py/objmodule.c): SFLAGS += -DMP_QSTR_usys="MP_QSTR_sys" +$(call object_for,python/src/extmod/modusys.c): SFLAGS += -DMP_QSTR_usys="MP_QSTR_sys" + # Handle upward-growing stack # Some platforms such as emscripten have a stack that grows up. We've rewritten # the stack control file to handle this case. diff --git a/python/port/genhdr/qstrdefs.in.h b/python/port/genhdr/qstrdefs.in.h index 6962c720b..7b198582c 100644 --- a/python/port/genhdr/qstrdefs.in.h +++ b/python/port/genhdr/qstrdefs.in.h @@ -9,7 +9,8 @@ * - "cat build/genhdr/qstrdefs.preprocessed.h|grep '^Q'|uniq". CAUTION: the * order is important, don't sort. * - Insert the result below in the MicroPython QSTRs section - * - remove "QSTR(urandom)" as we renamed it to random */ + * - remove "QSTR(urandom)" as we renamed it to random + * - remove "QSTR(usys)" as we renamed it to sys */ // Global configuration QCFG(BYTES_IN_LEN, (1)) @@ -331,7 +332,7 @@ Q(union) Q(update) Q(upper) Q(random) -Q(usys) +Q(sys) Q(value) Q(values) Q(version)