Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pymtl3/dsl/AstHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ def _get_full_name_starting_py39( self, input_node ):

low = up = None

if isinstance( lower, ast.Num ):
low = node.slice.lower.n
if isinstance( lower, ast.Constant ):
low = node.slice.lower.value
elif isinstance( lower, ast.Name ):
x = lower.id
if x in self.globals: low = (False, x)
elif x in self.closure: low = (True, x)

if isinstance( upper, ast.Num ):
up = node.slice.upper.n
if isinstance( upper, ast.Constant ):
up = node.slice.upper.value
elif isinstance( upper, ast.Name ):
x = upper.id
if x in self.globals: up = (False, x)
Expand All @@ -175,8 +175,8 @@ def _get_full_name_starting_py39( self, input_node ):

if isinstance( v, ast.Attribute ): # s.sel, may be constant
self.visit( v )
elif isinstance( v, ast.Num ):
n = v.n
elif isinstance( v, ast.Constant ):
n = v.value
elif isinstance( v, ast.Name ):
x = v.id
if x in self.globals: n = (False, x)
Expand Down
4 changes: 2 additions & 2 deletions pymtl3/dsl/ComponentLevel3.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def _create_assign_lambda( s, o, lamb ):
lineno=1+idx, col_offset=5+len(var),
),
slice=ast.Index(
value=ast.Num(
n=idx,
value=ast.Constant(
value=idx,
lineno=1+idx, col_offset=19+len(var),
),
),
Expand Down