Skip to content

Commit

Permalink
fixup 2nd commit (needs testing on mav)
Browse files Browse the repository at this point in the history
  • Loading branch information
Robadob committed Nov 27, 2023
1 parent e7b619f commit 64be40a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions swig/python/codegen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
from io import StringIO
from .codegen import CodeGenerator
from .codegen import CodeGenException
from typing import Callable, Union
from typing import Callable, Union, _SpecialForm
import ast
import inspect
import pyflamegpu

def codegen(tree: ast.AST) -> str:
"""
Expand Down Expand Up @@ -51,7 +52,7 @@ 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":
if (isinstance(val, _SpecialForm) and 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 64be40a

Please sign in to comment.