1.1 --- a/inspector.py Mon Nov 21 22:15:32 2016 +0100
1.2 +++ b/inspector.py Mon Nov 21 22:56:52 2016 +0100
1.3 @@ -169,6 +169,8 @@
1.4
1.5 "Process the individual node 'n'."
1.6
1.7 + path = self.get_namespace_path()
1.8 +
1.9 # Module global detection.
1.10
1.11 if isinstance(n, compiler.ast.Global):
1.12 @@ -225,10 +227,10 @@
1.13 # Assignments within non-Assign nodes.
1.14
1.15 elif isinstance(n, compiler.ast.AssName):
1.16 - self.process_assignment_node(n, None)
1.17 + raise InspectError("Name assignment appearing outside assignment statement.", path, n)
1.18
1.19 elif isinstance(n, compiler.ast.AssAttr):
1.20 - self.process_attribute_access(n)
1.21 + raise InspectError("Attribute assignment appearing outside assignment statement.", path, n)
1.22
1.23 # Accesses.
1.24
1.25 @@ -306,13 +308,13 @@
1.26 # Unsupported nodes.
1.27
1.28 elif isinstance(n, compiler.ast.GenExpr):
1.29 - raise InspectError("Generator expressions are not supported.", self.get_namespace_path(), n)
1.30 + raise InspectError("Generator expressions are not supported.", path, n)
1.31
1.32 elif isinstance(n, compiler.ast.IfExp):
1.33 - raise InspectError("If-else expressions are not supported.", self.get_namespace_path(), n)
1.34 + raise InspectError("If-else expressions are not supported.", path, n)
1.35
1.36 elif isinstance(n, compiler.ast.ListComp):
1.37 - raise InspectError("List comprehensions are not supported.", self.get_namespace_path(), n)
1.38 + raise InspectError("List comprehensions are not supported.", path, n)
1.39
1.40 # All other nodes are processed depth-first.
1.41