diff options
author | Leandro T. C. Melo <ltcmelo@gmail.com> | 2020-02-09 23:55:10 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-10 08:55:10 +0100 |
commit | 7dc1d50809a9f1c6b593c41949c28896c6ee0dd7 (patch) | |
tree | 194f38d5c545538fd5b51bcc0ab1e6f19fe709a3 /astroid/inference.py | |
parent | f8b779752327879536173eec33bdac347a465c34 (diff) | |
download | astroid-git-7dc1d50809a9f1c6b593c41949c28896c6ee0dd7.tar.gz |
Don't crash upon invalid contex on attr. inference (#746)
Diffstat (limited to 'astroid/inference.py')
-rw-r--r-- | astroid/inference.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/astroid/inference.py b/astroid/inference.py index 9c613cfe..7bbf9241 100644 --- a/astroid/inference.py +++ b/astroid/inference.py @@ -307,6 +307,8 @@ def infer_attribute(self, context=None): except exceptions._NonDeducibleTypeHierarchy: # Can't determine anything useful. pass + elif not context: + context = contextmod.InferenceContext() try: context.boundnode = owner |