summaryrefslogtreecommitdiff
path: root/astroid/inference.py
diff options
context:
space:
mode:
authorBryce Guinta <bryce.paul.guinta@gmail.com>2018-02-17 15:43:34 -0700
committerBryce Guinta <bryce.paul.guinta@gmail.com>2018-02-18 21:33:35 -0700
commit3fae32f99c7f432a1281b151ea17e163a2e8dc47 (patch)
tree3fff41d734c5eb79c801ac539645cbfb61a18f6b /astroid/inference.py
parent53516228e51826440a28503cc461cfc2c6988f9b (diff)
downloadastroid-git-3fae32f99c7f432a1281b151ea17e163a2e8dc47.tar.gz
Fix augassign recursion error
The augmented assign rhs context path was deleted most likely due to a recently fixed inference bug where InferenceContext path attributes were shared between objects. Recursive functions on the right hand side of the augmented assign would forget that they were already called, causing an eventual RecursionError in astroid inference Now that the InferenceContext clone() method properly copies the inference path between Contexts, it's fine to remove this hack. Fixes #437, Fixes #447, Fixes #313, Fixes PyCQA/pylint#1642, Fixes PyCQA/pylint#1805, Fixes PyCQA/pylint#1854, Fixes PyCQA/pylint#1452
Diffstat (limited to 'astroid/inference.py')
-rw-r--r--astroid/inference.py5
1 files changed, 0 insertions, 5 deletions
diff --git a/astroid/inference.py b/astroid/inference.py
index 12796855..5c83ed5e 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -713,12 +713,7 @@ def _infer_augassign(self, context=None):
yield util.Uninferable
return
- # TODO(cpopa): if we have A() * A(), trying to infer
- # the rhs with the same context will result in an
- # inference error, so we create another context for it.
- # This is a bug which should be fixed in InferenceContext at some point.
rhs_context = context.clone()
- rhs_context.path = set()
for rhs in self.value.infer(context=rhs_context):
if rhs is util.Uninferable:
# Don't know how to process this.