summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--astroid/inference.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/astroid/inference.py b/astroid/inference.py
index b7602ba0..8867e211 100644
--- a/astroid/inference.py
+++ b/astroid/inference.py
@@ -611,22 +611,6 @@ def _get_aug_flow(left, left_type, aug_opnode, right, right_type,
return methods
-def quickstart(func):
- """
- Run a generator enough to get the first value, and then buffer that value.
- This will raise any exceptions that happen during the generator startup
- when func is called, rather than when it is used.
- """
- @functools.wraps(func)
- def wrapper(*args, **kwargs):
- result_generator = func(*args, **kwargs)
- first_value = next(result_generator)
-
- return itertools.chain([first_value], result_generator)
- return wrapper
-
-
-@quickstart
def _infer_binary_operation(left, right, binary_opnode, context, flow_factory):
"""Infer a binary operation between a left operand and a right operand
@@ -700,12 +684,11 @@ def _infer_binop(self, context):
return
try:
- results = _infer_binary_operation(lhs, rhs, self, context, _get_binop_flow)
+ for result in _infer_binary_operation(lhs, rhs, self,
+ context, _get_binop_flow):
+ yield result
except exceptions._NonDeducibleTypeHierarchy:
yield util.Uninferable
- else:
- for result in results:
- yield result
@decorators.yes_if_nothing_inferred