Skip to content

Commit

Permalink
BugFix: #1147 broke Python 3.8.13
Browse files Browse the repository at this point in the history
This variant has been tested on both 3.8.13 and 3.10.12
  • Loading branch information
Robadob committed Nov 27, 2023
1 parent 7c4ed35 commit 6754424
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion swig/python/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 6754424

Please sign in to comment.