1.1 --- a/translator.py Sat Dec 10 14:04:01 2016 +0100
1.2 +++ b/translator.py Sat Dec 10 17:32:16 2016 +0100
1.3 @@ -321,7 +321,8 @@
1.4
1.5 # NOTE: This makes assumptions about the __builtins__ structure.
1.6
1.7 - return self.importer.get_object("__builtins__.%s.%s" % (name, name))
1.8 + modname = get_builtin_module(name)
1.9 + return self.importer.get_object("__builtins__.%s.%s" % (modname, name))
1.10
1.11 def is_method(self, path):
1.12
1.13 @@ -410,6 +411,11 @@
1.14 For node 'n', return a reference for the type of the given 'name'.
1.15 """
1.16
1.17 + # Handle stray None constants (Sliceobj seems to produce them).
1.18 +
1.19 + if name == "NoneType":
1.20 + return self.process_name_node(compiler.ast.Name("None"))
1.21 +
1.22 ref = self.get_builtin_class(name)
1.23
1.24 if name in ("dict", "list", "tuple"):