Skip to content

Commit

Permalink
Accessing numerical constant value with node.value for Python >= 3.8.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnick83 committed Oct 8, 2023
1 parent b5cb4b6 commit 52011cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dace/frontend/python/astutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ def visit_Constant(self, node):

def visit_Num(self, node: NumConstant):
newname = f'__uu{self.id}'
self.gvars[newname] = node.n
self.gvars[newname] = node.value if sys.version_info >= (3, 8) else node.n
self.id += 1
return ast.copy_location(ast.Name(id=newname, ctx=ast.Load()), node)

Expand Down

0 comments on commit 52011cb

Please sign in to comment.