diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2009-02-16 15:36:02 +0100 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2009-02-16 15:36:02 +0100 |
commit | a0196df266af67bf2081f13ef232b74af1ed057f (patch) | |
tree | a98ad447c66dc83951991ac442609bce62e677b2 | |
parent | 9b8cd9bf56c2509d2ad9c9e0f4da6f4da2aaf588 (diff) | |
download | astroid-git-a0196df266af67bf2081f13ef232b74af1ed057f.tar.gz |
more 'are_exclusive' bugs
--HG--
branch : _ast_compat
-rw-r--r-- | utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -205,9 +205,11 @@ def _try_except_from_branch(node, stmt): """returns values to compare to nodes""" if stmt in node.body: return 'body', 1 - if stmt is node.orelse: + if stmt in node.orelse: return 'else', 1 for i, handler in enumerate(node.handlers): + if stmt is handler: + return 'except', i if stmt in handler.body: return 'except', i raise ASTNGError, "comparing try_except nodes '%s' '%s'" % (node, stmt) |