Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

fix issue34 #50

Merged
merged 2 commits into from

3 participants

@clayg

no longer incorrectly report W602 when using raise three-tuple to preserve original sys.exc_info() traceback.

@florentx
Collaborator

Accepted and merged in my branch.
Thanks.

@florentx
Collaborator

Released in 0.7.

@bdelliott

Please see #53

I fixed the regex used for this.

@florentx florentx merged commit c7730e1 into jcrocholl:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 2, 2012
  1. @clayg

    test for issue34

    clayg authored
  2. @clayg

    fix for issue34

    clayg authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 1 deletion.
  1. +2 −1  pep8.py
  2. +2 −0  testsuite/W60.py
View
3  pep8.py
@@ -115,6 +115,7 @@ def blank_lines(logical_line, blank_lines, indent_level, line_number)
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')
SELFTEST_REGEX = re.compile(r'(Okay|[EW]\d{3}):\s(.*)')
ERRORCODE_REGEX = re.compile(r'[EW]\d{3}')
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
@@ -687,7 +688,7 @@ def python_3000_raise_comma(logical_line):
form will be removed in Python 3000.
"""
match = RAISE_COMMA_REGEX.match(logical_line)
- if match:
+ if match and not RERAISE_COMMA_REGEX.match(logical_line):
return match.start(1), "W602 deprecated form of raising exception"
View
2  testsuite/W60.py
@@ -3,6 +3,8 @@
print a
#: W602
raise DummyError, "Message"
+#: Okay
+raise t, v, tb
#: W603
if x <> 0:
x = 0
Something went wrong with that request. Please try again.