From 67544245e0f6cc7a6a90a65e297853e14f422083 Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Mon, 27 Nov 2023 13:54:27 +0000 Subject: [PATCH] BugFix: #1147 broke Python 3.8.13 This variant has been tested on both 3.8.13 and 3.10.12 --- swig/python/codegen/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/swig/python/codegen/__init__.py b/swig/python/codegen/__init__.py index cf27dd11d..926fa6e66 100644 --- a/swig/python/codegen/__init__.py +++ b/swig/python/codegen/__init__.py @@ -51,7 +51,8 @@ def translate(function: Union[str, Callable]) -> str: prepend_c_source = "" # Find all annotated variables for key, val in module_annontations.items(): - if val.__name__ == "Final" or val.__name__ == "constant": + print(val._name) + if val._name == "Final" or val._name == "constant": # Locate the literal for that variable (Python will precompute anything e.g. math.sqrt(12.5)) for mem in module_members: if key == mem[0]: