mirror of
https://github.com/m-labs/artiq.git
synced 2024-12-26 03:38:25 +08:00
analyses.constness: fix false positive on x[...].
This commit is contained in:
parent
fd1d77767e
commit
ebb3205dff
@ -17,6 +17,12 @@ class Constness(algorithm.Visitor):
|
|||||||
self.visit(node.targets)
|
self.visit(node.targets)
|
||||||
self.in_assign = False
|
self.in_assign = False
|
||||||
|
|
||||||
|
def visit_SubscriptT(self, node):
|
||||||
|
old_in_assign, self.in_assign = self.in_assign, False
|
||||||
|
self.visit(node.value)
|
||||||
|
self.visit(node.slice)
|
||||||
|
self.in_assign = old_in_assign
|
||||||
|
|
||||||
def visit_AttributeT(self, node):
|
def visit_AttributeT(self, node):
|
||||||
self.generic_visit(node)
|
self.generic_visit(node)
|
||||||
if self.in_assign:
|
if self.in_assign:
|
||||||
|
Loading…
Reference in New Issue
Block a user