diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2012-03-26 02:10:52 +0200 |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2012-03-26 02:10:52 +0200 |
commit | cf30c8fc1dd03098262b9707a7769f4ba83395d4 (patch) | |
tree | 213d28a6c107b282480420a7dc8802c3560a29e9 | |
parent | cba8f177ed560d25cebad65e86850d9c96c95b78 (diff) | |
parent | e7c34145ca57fcccdb44cbc6c0f4adbf3df7590f (diff) | |
download | pep8-cf30c8fc1dd03098262b9707a7769f4ba83395d4.tar.gz |
Merge branch 'master' of git://github.com/fabioz/pep8
-rwxr-xr-x | pep8.py | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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: |