From e6926d60219d9b00da3eedb5eedecefe0d6c321c Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Tue, 6 Jun 2023 22:49:50 +1000 Subject: py/objmodule: Workaround for MSVC with no module delegation. When compiling mpy-cross, there is no `sys` module, and so there will be no entries in the `mp_builtin_module_delegation_table`. MSVC doesn't like this, so instead pretend as if the feature isn't enabled at all. Signed-off-by: Jim Mussared --- py/makemoduledefs.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'py/makemoduledefs.py') diff --git a/py/makemoduledefs.py b/py/makemoduledefs.py index 5a1362a4c9..b1e118bf37 100644 --- a/py/makemoduledefs.py +++ b/py/makemoduledefs.py @@ -103,6 +103,9 @@ def generate_module_table_header(modules): def generate_module_delegations(delegations): + if not delegations: + return + print("\n#define MICROPY_MODULE_DELEGATIONS \\") for obj_module, fun_name in delegations: print( -- cgit v1.2.3