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 | 3db80ba79af11ea6d3677ad3b79270d033ca86fc (patch) | |
tree | 2cd4baa58f7bd8fffe286e659eecc062889d2692 /pylint/checkers/exceptions.py | |
parent | 5d7d1c5ad3edf9ea2e8b1756219e300cfd40c8c2 (diff) | |
download | pylint-git-3db80ba79af11ea6d3677ad3b79270d033ca86fc.tar.gz |
Fix index out of range when handling raise()
Diffstat (limited to 'pylint/checkers/exceptions.py')
-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 f40c2aa28..7f3d92ce7 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, ) |