diff options
author | Rene Zhang <rz99@cornell.edu> | 2015-08-20 18:11:32 -0700 |
---|---|---|
committer | Rene Zhang <rz99@cornell.edu> | 2015-08-20 18:11:32 -0700 |
commit | b24529ad5e8f10265d2563dd16517aaaf3bff512 (patch) | |
tree | 3ff85c70f7fa93b573ad612fd1b455f36fc80b12 /pylint/checkers | |
parent | 7a37a32a84a322d8c64b8ecd508e0dd9f34b995c (diff) | |
download | pylint-b24529ad5e8f10265d2563dd16517aaaf3bff512.tar.gz |
Fix index out of range when handling raise()
Diffstat (limited to 'pylint/checkers')
-rw-r--r-- | pylint/checkers/exceptions.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pylint/checkers/exceptions.py b/pylint/checkers/exceptions.py index f40c2aa..7f3d92c 100644 --- a/pylint/checkers/exceptions.py +++ b/pylint/checkers/exceptions.py @@ -194,7 +194,8 @@ class ExceptionsChecker(BaseChecker): isinstance(expr, (astroid.List, astroid.Dict, astroid.Tuple, astroid.Module, astroid.Function))): emit = True - if not PY3K and isinstance(expr, astroid.Tuple): + if (not PY3K and isinstance(expr, astroid.Tuple) and + len(expr.elts) > 0): # On Python 2, using the following is not an error: # raise (ZeroDivisionError, None) # raise (ZeroDivisionError, ) |