Skip to content

Commit 1825dec

Browse files
committed
Fix regression with E22 checks and inline comments; issue #271
1 parent a2c3b9b commit 1825dec

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

CHANGES.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ Changelog
22
=========
33

44

5+
1.x (unreleased)
6+
----------------
7+
8+
Bug fixes:
9+
10+
* Fix regression with E22 checks and inline comments. (Issue #271)
11+
12+
513
1.5.4 (2014-04-07)
614
------------------
715

16+
Bug fixes:
17+
818
* Fix negative offset with E303 before a multi-line docstring.
919
(Issue #269)
1020

pep8.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"""
4747
from __future__ import with_statement
4848

49-
__version__ = '1.5.4'
49+
__version__ = '1.5.5a0'
5050

5151
import os
5252
import sys
@@ -90,6 +90,7 @@
9090
WHITESPACE = frozenset(' \t')
9191
SKIP_TOKENS = frozenset([tokenize.NL, tokenize.NEWLINE,
9292
tokenize.INDENT, tokenize.DEDENT])
93+
SKIP_TOKENS_C = SKIP_TOKENS.union([tokenize.COMMENT])
9394
BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']
9495

9596
INDENT_REGEX = re.compile(r'([ \t]*)')
@@ -702,7 +703,7 @@ def missing_whitespace_around_operator(logical_line, tokens):
702703
elif prev_type == tokenize.NAME:
703704
binary_usage = (prev_text not in KEYWORDS)
704705
else:
705-
binary_usage = (prev_type not in SKIP_TOKENS)
706+
binary_usage = (prev_type not in SKIP_TOKENS_C)
706707

707708
if binary_usage:
708709
need_space = None

testsuite/E22.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,9 @@ def squares(n):
149149

150150
def squares(n):
151151
return (i ** 2 for i in range(n))
152+
153+
ENG_PREFIXES = {
154+
-6: "\u03bc", # Greek letter mu
155+
-3: "m",
156+
}
152157
#:

0 commit comments

Comments
 (0)