diff options
author | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-03-17 12:33:44 +0100 |
---|---|---|
committer | Sylvain Thénault <sylvain.thenault@logilab.fr> | 2009-03-17 12:33:44 +0100 |
commit | 7c796fefa0cebe42f343ca7e3e0397ff383635cb (patch) | |
tree | a18fb389bd52f16ceeb1f22ba4479f69b404be73 | |
parent | 69041de75ae6b40cc06c90c87276ca77089e67a0 (diff) | |
download | astroid-git-7c796fefa0cebe42f343ca7e3e0397ff383635cb.tar.gz |
fix YES handling
--HG--
branch : _ast_compat
-rw-r--r-- | inference.py | 1 | ||||
-rw-r--r-- | protocols.py | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/inference.py b/inference.py index ee5634bb..c849a801 100644 --- a/inference.py +++ b/inference.py @@ -357,6 +357,7 @@ BIN_OP_METHOD = {'+': '__add__', def _infer_binop(operator, operand1, operand2, context, failures=None): if operand1 is YES: yield operand1 + return try: for valnode in operand1.infer_binary_op(operator, operand2, context): yield valnode diff --git a/protocols.py b/protocols.py index 9f1834ec..f98731e4 100644 --- a/protocols.py +++ b/protocols.py @@ -81,6 +81,8 @@ def const_infer_binary_op(self, operator, other, context): except TypeError: # XXX log TypeError continue + elif other is YES: + yield other else: try: for val in other.infer_binary_op(operator, self, context): |