summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 23:56:59 +0100
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-03-24 23:56:59 +0100
commit173592fccdef25078d599e0f748650ef43ed13cc (patch)
tree9ef17b98ee32957fff9bd080415d69aaf9260f83
parentca37ce87c8446b13abf18d0a9079479914834ee1 (diff)
downloadpep8-173592fccdef25078d599e0f748650ef43ed13cc.tar.gz
Relax a bit the regex for W602, 3-arguments raise; closes #34
-rw-r--r--CHANGES.txt2
-rwxr-xr-xpep8.py2
-rw-r--r--testsuite/W60.py1
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 7e3b45b..cc5c0b6 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -30,6 +30,8 @@ Changelog
* Do not report multiple E101 if only the first indentation starts
with a tab. (Issue #237)
+* Fix a rare false positive W602. (Issue #34)
+
1.4.6 (2013-07-02)
------------------
diff --git a/pep8.py b/pep8.py
index 3961037..d81f9ae 100755
--- a/pep8.py
+++ b/pep8.py
@@ -93,7 +93,7 @@ BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']
INDENT_REGEX = re.compile(r'([ \t]*)')
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,')
-RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+')
+RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$')
ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b')
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
diff --git a/testsuite/W60.py b/testsuite/W60.py
index 6d819ee..973d22f 100644
--- a/testsuite/W60.py
+++ b/testsuite/W60.py
@@ -7,6 +7,7 @@ raise DummyError, "Message"
raise ValueError, "hello %s %s" % (1, 2)
#: Okay
raise type_, val, tb
+raise Exception, Exception("f"), t
#: W603
if x <> 0:
x = 0