diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2014-03-24 23:56:59 +0100 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2014-03-24 23:56:59 +0100 |
commit | 173592fccdef25078d599e0f748650ef43ed13cc (patch) | |
tree | 9ef17b98ee32957fff9bd080415d69aaf9260f83 | |
parent | ca37ce87c8446b13abf18d0a9079479914834ee1 (diff) | |
download | pep8-173592fccdef25078d599e0f748650ef43ed13cc.tar.gz |
Relax a bit the regex for W602, 3-arguments raise; closes #34
-rw-r--r-- | CHANGES.txt | 2 | ||||
-rwxr-xr-x | pep8.py | 2 | ||||
-rw-r--r-- | testsuite/W60.py | 1 |
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) ------------------ @@ -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 |