summaryrefslogtreecommitdiff
path: root/pylint/checkers
diff options
context:
space:
mode:
authorRene Zhang <rz99@cornell.edu>2015-08-20 18:11:32 -0700
committerRene Zhang <rz99@cornell.edu>2015-08-20 18:11:32 -0700
commitb24529ad5e8f10265d2563dd16517aaaf3bff512 (patch)
tree3ff85c70f7fa93b573ad612fd1b455f36fc80b12 /pylint/checkers
parent7a37a32a84a322d8c64b8ecd508e0dd9f34b995c (diff)
downloadpylint-b24529ad5e8f10265d2563dd16517aaaf3bff512.tar.gz
Fix index out of range when handling raise()
Diffstat (limited to 'pylint/checkers')
-rw-r--r--pylint/checkers/exceptions.py3
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, )