1.1 --- a/inspector.py Sat Dec 10 14:04:01 2016 +0100
1.2 +++ b/inspector.py Sat Dec 10 17:32:16 2016 +0100
1.3 @@ -21,7 +21,8 @@
1.4 """
1.5
1.6 from branching import BranchTracker
1.7 -from common import CommonModule, get_argnames, init_item, predefined_constants
1.8 +from common import CommonModule, get_argnames, get_builtin_type, init_item, \
1.9 + predefined_constants
1.10 from modules import BasicModule, CacheWritingModule, InspectionNaming
1.11 from errors import InspectError
1.12 from referencing import Reference
1.13 @@ -294,7 +295,7 @@
1.14
1.15 elif isinstance(n, compiler.ast.Const):
1.16 typename = n.value.__class__.__name__
1.17 - return self.get_literal_instance(n, typename == "str" and "string" or typename)
1.18 + return self.get_literal_instance(n, get_builtin_type(typename))
1.19
1.20 elif isinstance(n, compiler.ast.Dict):
1.21 return self.get_literal_instance(n, "dict")
1.22 @@ -1386,6 +1387,11 @@
1.23
1.24 "For node 'n', return a reference to an instance of 'name'."
1.25
1.26 + # Handle stray None constants (Sliceobj seems to produce them).
1.27 +
1.28 + if name == "NoneType":
1.29 + return self.process_name_node(compiler.ast.Name("None"))
1.30 +
1.31 # Get a reference to the built-in class.
1.32
1.33 ref = self.get_builtin_class(name)