From f7254dd3cec770458f82d546bd4a4f1d893be6fc Mon Sep 17 00:00:00 2001 From: whitequark Date: Fri, 9 Jun 2017 07:31:08 +0000 Subject: [PATCH] compiler.validators.constness: take AugAssign into account. --- artiq/compiler/validators/constness.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/artiq/compiler/validators/constness.py b/artiq/compiler/validators/constness.py index 53f987bed..bfe228015 100644 --- a/artiq/compiler/validators/constness.py +++ b/artiq/compiler/validators/constness.py @@ -17,6 +17,12 @@ class ConstnessValidator(algorithm.Visitor): self.visit(node.targets) self.in_assign = False + def visit_AugAssign(self, node): + self.visit(node.value) + self.in_assign = True + self.visit(node.target) + self.in_assign = False + def visit_SubscriptT(self, node): old_in_assign, self.in_assign = self.in_assign, False self.visit(node.value)