Skip to content

Commit 173592f

Browse files
committed
Relax a bit the regex for W602, 3-arguments raise; closes #34
1 parent ca37ce8 commit 173592f

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

CHANGES.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Changelog
3030
* Do not report multiple E101 if only the first indentation starts
3131
with a tab. (Issue #237)
3232

33+
* Fix a rare false positive W602. (Issue #34)
34+
3335

3436
1.4.6 (2013-07-02)
3537
------------------

pep8.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
INDENT_REGEX = re.compile(r'([ \t]*)')
9595
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,')
96-
RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+')
96+
RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,.*,\s*\w+\s*$')
9797
ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b')
9898
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
9999
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')

testsuite/W60.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
raise ValueError, "hello %s %s" % (1, 2)
88
#: Okay
99
raise type_, val, tb
10+
raise Exception, Exception("f"), t
1011
#: W603
1112
if x <> 0:
1213
x = 0

0 commit comments

Comments
 (0)