summaryrefslogtreecommitdiff
path: root/bases.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2011-07-08 20:16:52 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2011-07-08 20:16:52 +0200
commit479bc8a3204c0617822e17420160f8c2639b6a68 (patch)
tree7fa5dee3198de790fa8b6a49ebe704f1e0d42cb4 /bases.py
parent80fea3a8df4d6f1c537f1a4d0ee74c5bd17f7a2d (diff)
downloadastroid-479bc8a3204c0617822e17420160f8c2639b6a68.tar.gz
py3k: __builtin__ module renamed to builtins, we should consider this to properly build ast for builtin objects
Diffstat (limited to 'bases.py')
-rw-r--r--bases.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bases.py b/bases.py
index 499dd6b..1de9664 100644
--- a/bases.py
+++ b/bases.py
@@ -26,6 +26,8 @@ __docformat__ = "restructuredtext en"
from logilab.common.compat import builtins
+
+from logilab.astng import BUILTINS_MODULE
from logilab.astng.exceptions import InferenceError, ASTNGError, \
NotFoundError, UnresolvableName
from logilab.astng.as_string import as_string
@@ -242,7 +244,7 @@ class UnboundMethod(Proxy):
# If we're unbound method __new__ of builtin object, the result is an
# instance of the class given as first argument.
if (self._proxied.name == '__new__' and
- self._proxied.parent.frame().qname() == '__builtin__.object'):
+ self._proxied.parent.frame().qname() == '%s.object' % BUILTINS_MODULE):
return (x is YES and x or Instance(x) for x in caller.args[0].infer())
return self._proxied.infer_call_result(caller, context)
@@ -268,7 +270,7 @@ class Generator(Instance):
return True
def pytype(self):
- return '__builtin__.generator'
+ return '%s.generator' % BUILTINS_MODULE
def display_type(self):
return 'Generator'