|
92 | 92 | BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines'] |
93 | 93 |
|
94 | 94 | 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*,') |
96 | 96 | RERAISE_COMMA_REGEX = re.compile(r'raise\s+\w+\s*,\s*\w+\s*,\s*\w+') |
97 | 97 | ERRORCODE_REGEX = re.compile(r'\b[A-Z]\d{3}\b') |
98 | 98 | DOCSTRING_REGEX = re.compile(r'u?r?["\']') |
@@ -947,7 +947,7 @@ def comparison_type(logical_line): |
947 | 947 | inst = match.group(1) |
948 | 948 | if inst and isidentifier(inst) and inst not in SINGLETONS: |
949 | 949 | 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()'" |
951 | 951 |
|
952 | 952 |
|
953 | 953 | def python_3000_has_key(logical_line): |
@@ -978,7 +978,7 @@ def python_3000_raise_comma(logical_line): |
978 | 978 | """ |
979 | 979 | match = RAISE_COMMA_REGEX.match(logical_line) |
980 | 980 | 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" |
982 | 982 |
|
983 | 983 |
|
984 | 984 | def python_3000_not_equal(logical_line): |
|
0 commit comments