1.1 --- a/inspector.py Mon Feb 06 22:30:47 2017 +0100
1.2 +++ b/inspector.py Tue Feb 07 23:37:40 2017 +0100
1.3 @@ -438,7 +438,7 @@
1.4 # Record attribute usage in the tracker, and record the branch
1.5 # information for the access.
1.6
1.7 - branches = tracker.use_attribute(name, attrname, self.in_invocation, assignment)
1.8 + branches = tracker.use_attribute(name, attrname, self.in_invocation is not None, assignment)
1.9
1.10 if not branches:
1.11 raise InspectError("Name %s is accessed using %s before an assignment." % (
1.12 @@ -746,12 +746,12 @@
1.13 # target of an invocation, potentially affecting attribute accesses.
1.14
1.15 in_invocation = self.in_invocation
1.16 - self.in_invocation = True
1.17 + self.in_invocation = len(n.args)
1.18
1.19 # Process the expression, obtaining any identified reference.
1.20
1.21 name_ref = self.process_structure_node(n.node)
1.22 - self.in_invocation = False
1.23 + self.in_invocation = None
1.24
1.25 # Process the arguments.
1.26
1.27 @@ -885,7 +885,7 @@
1.28
1.29 if branches:
1.30 self.record_branches_for_access(branches, n.name, None)
1.31 - access_number = self.record_access_details(n.name, None, False, False)
1.32 + access_number = self.record_access_details(n.name, None, None, None)
1.33 return LocalNameRef(n.name, access_number)
1.34
1.35 # Possible global or built-in name.
1.36 @@ -1147,7 +1147,7 @@
1.37
1.38 """
1.39 For the given 'name' and 'attrnames', record an access indicating
1.40 - whether 'assignment' is occurring.
1.41 + whether an 'assignment' or an 'invocation' is occurring.
1.42
1.43 These details correspond to accesses otherwise recorded by the attribute
1.44 accessor and attribute access dictionaries.