summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2014-04-09 00:31:29 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2014-04-09 00:31:29 +0200
commit1825decf9f755385f0c18382faaa2aa7c59d89be (patch)
tree85a3b7413745a6a57f582e63e7aaf38586b4eecc
parenta2c3b9b05928000b5494a1c13c3068cd53eaf8f5 (diff)
downloadpep8-1825decf9f755385f0c18382faaa2aa7c59d89be.tar.gz
Fix regression with E22 checks and inline comments; issue #271
-rw-r--r--CHANGES.txt10
-rwxr-xr-xpep8.py5
-rw-r--r--testsuite/E22.py5
3 files changed, 18 insertions, 2 deletions
diff --git a/CHANGES.txt b/CHANGES.txt
index 479ba1f..7b77d65 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -2,9 +2,19 @@ Changelog
=========
+1.x (unreleased)
+----------------
+
+Bug fixes:
+
+* Fix regression with E22 checks and inline comments. (Issue #271)
+
+
1.5.4 (2014-04-07)
------------------
+Bug fixes:
+
* Fix negative offset with E303 before a multi-line docstring.
(Issue #269)
diff --git a/pep8.py b/pep8.py
index 4662cd7..9f4d7f3 100755
--- a/pep8.py
+++ b/pep8.py
@@ -46,7 +46,7 @@ W warnings
"""
from __future__ import with_statement
-__version__ = '1.5.4'
+__version__ = '1.5.5a0'
import os
import sys
@@ -90,6 +90,7 @@ WS_NEEDED_OPERATORS = frozenset([
WHITESPACE = frozenset(' \t')
SKIP_TOKENS = frozenset([tokenize.NL, tokenize.NEWLINE,
tokenize.INDENT, tokenize.DEDENT])
+SKIP_TOKENS_C = SKIP_TOKENS.union([tokenize.COMMENT])
BENCHMARK_KEYS = ['directories', 'files', 'logical lines', 'physical lines']
INDENT_REGEX = re.compile(r'([ \t]*)')
@@ -702,7 +703,7 @@ def missing_whitespace_around_operator(logical_line, tokens):
elif prev_type == tokenize.NAME:
binary_usage = (prev_text not in KEYWORDS)
else:
- binary_usage = (prev_type not in SKIP_TOKENS)
+ binary_usage = (prev_type not in SKIP_TOKENS_C)
if binary_usage:
need_space = None
diff --git a/testsuite/E22.py b/testsuite/E22.py
index 2ff470b..7617eb8 100644
--- a/testsuite/E22.py
+++ b/testsuite/E22.py
@@ -149,4 +149,9 @@ if alpha[:-i]:
def squares(n):
return (i ** 2 for i in range(n))
+
+ENG_PREFIXES = {
+ -6: "\u03bc", # Greek letter mu
+ -3: "m",
+}
#: