summaryrefslogtreecommitdiff
path: root/astroid/arguments.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-11-17 10:46:45 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2019-11-17 10:46:45 +0100
commitb55fc8d9731e3527ab9c4c34488a6471d0aca62f (patch)
tree6b721d04f9e819e5bfd9abca6e838e2105c8b80e /astroid/arguments.py
parent060fc2fd30dbcf8b59b8fa7d37fd9a9311af0572 (diff)
downloadastroid-git-b55fc8d9731e3527ab9c4c34488a6471d0aca62f.tar.gz
Add support for inferring exception instances in all contexts
We were able to infer exception instances as ``ExceptionInstance`` only for a handful of cases, but not all. ``ExceptionInstance`` has support for better inference of `.args` and other exception related attributes that normal instances do not have. This additional support should remove certain false positives related to ``.args`` and other exception attributes in ``pylint``. Close PyCQA/pylint#2333
Diffstat (limited to 'astroid/arguments.py')
-rw-r--r--astroid/arguments.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/astroid/arguments.py b/astroid/arguments.py
index c4bdc6d9..0a853605 100644
--- a/astroid/arguments.py
+++ b/astroid/arguments.py
@@ -209,7 +209,7 @@ class CallSite:
if funcnode.type == "method":
if not isinstance(boundnode, bases.Instance):
- boundnode = bases.Instance(boundnode)
+ boundnode = boundnode.instantiate_class()
return iter((boundnode,))
if funcnode.type == "classmethod":
return iter((boundnode,))