summaryrefslogtreecommitdiff
path: root/bases.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-08-21 00:26:38 +0300
committerClaudiu Popa <pcmanticore@gmail.com>2014-08-21 00:26:38 +0300
commitc0d23bf0d76e70c53800ac6863a708514d76699a (patch)
treef82776f5e9e5b2391d29f7147769e91a93352f57 /bases.py
parent9b425408b3f40f5afad498854b458b557bf532ad (diff)
downloadastroid-git-c0d23bf0d76e70c53800ac6863a708514d76699a.tar.gz
Don't crash when trying to infer unbound object.__new__ call. Closes issue #11.
Diffstat (limited to 'bases.py')
-rw-r--r--bases.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/bases.py b/bases.py
index e8544714..37e613b8 100644
--- a/bases.py
+++ b/bases.py
@@ -259,8 +259,8 @@ class UnboundMethod(Proxy):
# instance of the class given as first argument.
if (self._proxied.name == '__new__' and
self._proxied.parent.frame().qname() == '%s.object' % BUILTINS):
- return ((x is YES and x or Instance(x))
- for x in caller.args[0].infer())
+ infer = caller.args[0].infer() if caller.args else []
+ return ((x is YES and x or Instance(x)) for x in infer)
return self._proxied.infer_call_result(caller, context)