Skip to content

Commit 920c143

Browse files
committed
Use default value for the whole re match
1 parent 67b8be8 commit 920c143

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pep8.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']
9393

9494
INDENT_REGEX = re.compile(r'([ \t]*)')
95-
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*(,)')
95+
RAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,')
9696
RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+')
9797
ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b')
9898
DOCSTRING_REGEX = re.compile(r'u?r?["\']')
@@ -947,7 +947,7 @@ def comparison_type(logical_line):
947947
inst = match.group(1)
948948
if inst and isidentifier(inst) and inst not in SINGLETONS:
949949
return # Allow comparison for types which are not obvious
950-
yield match.start(0), "E721 do not compare types, use 'isinstance()'"
950+
yield match.start(), "E721 do not compare types, use 'isinstance()'"
951951

952952

953953
def python_3000_has_key(logical_line):
@@ -978,7 +978,7 @@ def python_3000_raise_comma(logical_line):
978978
"""
979979
match = RAISE_COMMA_REGEX.match(logical_line)
980980
if match and not RERAISE_COMMA_REGEX.match(logical_line):
981-
yield match.start(1), "W602 deprecated form of raising exception"
981+
yield match.end() - 1, "W602 deprecated form of raising exception"
982982

983983

984984
def python_3000_not_equal(logical_line):

0 commit comments

Comments
 (0)