diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-22 17:22:06 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-03-22 17:22:06 +0100 |
commit | b83ef46aad8e892c2dc8e38ea6cb81480f42d8fd (patch) | |
tree | 0315d6fb5e77def0fb8023edeaa664efadb02f4a /protocols.py | |
parent | c5172d8a33f3f355eac6b1aa6dc123257dba6ffd (diff) | |
download | astroid-git-b83ef46aad8e892c2dc8e38ea6cb81480f42d8fd.tar.gz |
catch arithmetic errors in const_infer_binary_op
Diffstat (limited to 'protocols.py')
-rw-r--r-- | protocols.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/protocols.py b/protocols.py index 40de339c..9f21f1a1 100644 --- a/protocols.py +++ b/protocols.py @@ -82,7 +82,13 @@ def const_infer_binary_op(self, operator, other, context): if isinstance(other, nodes.Const): try: impl = BIN_OP_IMPL[operator] - yield const_factory(impl(self.value, other.value)) + + try: + yield const_factory(impl(self.value, other.value)) + except StandardError: + # ArithmeticError is not enough: float >> float is a TypeError + # TODO : let pylint know about the problem + pass except TypeError: # XXX log TypeError continue |