1.1 --- a/inspector.py Sun Feb 19 17:56:06 2017 +0100
1.2 +++ b/inspector.py Mon Feb 20 00:35:08 2017 +0100
1.3 @@ -412,7 +412,7 @@
1.4 # if assigned in the namespace, or using an external name
1.5 # (presently just globals within classes).
1.6
1.7 - name = self.get_name_for_tracking(name_ref.name, name_ref.reference())
1.8 + name = self.get_name_for_tracking(name_ref.name, name_ref)
1.9 tracker = self.trackers[-1]
1.10
1.11 immediate_access = len(self.attrs) == 1
1.12 @@ -420,10 +420,7 @@
1.13
1.14 # Record global-based chains for subsequent resolution.
1.15
1.16 - is_global = self.in_function and not self.function_locals[path].has_key(name) or \
1.17 - not self.in_function
1.18 -
1.19 - if is_global:
1.20 + if name_ref.is_global_name():
1.21 self.record_global_access_details(name, attrnames)
1.22
1.23 # Make sure the name is being tracked: global names will not
1.24 @@ -873,12 +870,12 @@
1.25
1.26 ref = self.find_name(n.name)
1.27 if ref:
1.28 - return ResolvedNameRef(n.name, ref)
1.29 + return ResolvedNameRef(n.name, ref, is_global=True)
1.30
1.31 # Explicitly-declared global names.
1.32
1.33 elif self.in_function and n.name in self.scope_globals[path]:
1.34 - return NameRef(n.name)
1.35 + return NameRef(n.name, is_global=True)
1.36
1.37 # Examine other names.
1.38
1.39 @@ -899,7 +896,7 @@
1.40 # Possible global or built-in name.
1.41
1.42 else:
1.43 - return NameRef(n.name)
1.44 + return NameRef(n.name, is_global=True)
1.45
1.46 def process_operator_chain(self, nodes, fn):
1.47