summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2012-03-26 02:10:52 +0200
committerFlorent Xicluna <florent.xicluna@gmail.com>2012-03-26 02:10:52 +0200
commitcf30c8fc1dd03098262b9707a7769f4ba83395d4 (patch)
tree213d28a6c107b282480420a7dc8802c3560a29e9
parentcba8f177ed560d25cebad65e86850d9c96c95b78 (diff)
parente7c34145ca57fcccdb44cbc6c0f4adbf3df7590f (diff)
downloadpep8-cf30c8fc1dd03098262b9707a7769f4ba83395d4.tar.gz
Merge branch 'master' of git://github.com/fabioz/pep8
-rwxr-xr-xpep8.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/pep8.py b/pep8.py
index 059c85e..ae41d21 100755
--- a/pep8.py
+++ b/pep8.py
@@ -108,6 +108,11 @@ try:
except NameError:
from sets import ImmutableSet as frozenset
+#Fix to work on Jython 2.2.1
+try:
+ UnicodeDecodeError
+except NameError:
+ UnicodeDecodeError = UnicodeError
DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git'
DEFAULT_IGNORE = 'E24'
@@ -124,7 +129,7 @@ WHITESPACE_AROUND_OPERATOR_REGEX = \
EXTRANEOUS_WHITESPACE_REGEX = re.compile(r'[[({] | []}),;:]')
WHITESPACE_AROUND_NAMED_PARAMETER_REGEX = \
re.compile(r'[()]|\s=[^=]|[^=!<>]=\s')
-
+LAMBDA_REGEX = re.compile(r'\blambda\b')
WHITESPACE = ' \t'
@@ -657,7 +662,7 @@ def compound_statements(logical_line):
before = line[:found]
if (before.count('{') <= before.count('}') and # {'a': 1} (dict)
before.count('[') <= before.count(']') and # [1:2] (slice)
- not re.search(r'\blambda\b', before)): # lambda x: x
+ not LAMBDA_REGEX.search(before)): # lambda x: x
return found, "E701 multiple statements on one line (colon)"
found = line.find(';')
if -1 < found: