Skip to content

Commit 39895aa

Browse files
author
Susannah Klaneček
committed
Handle
1 parent 5230110 commit 39895aa

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

pycodestyle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ def lru_cache(maxsize=128): # noqa as it's a fake implementation.
140140
WHITESPACE_AFTER_COMMA_REGEX = re.compile(r'[,;:]\s*(?: |\t)')
141141
COMPARE_SINGLETON_REGEX = re.compile(r'(\bNone|\bFalse|\bTrue)?\s*([=!]=)'
142142
r'\s*(?(1)|(None|False|True))\b')
143-
COMPARE_NEGATIVE_REGEX = re.compile(r'\b(not)\s+[^][)(}{ ]+\s+(in|is)'
144-
r'\s+(?!not\s)')
143+
COMPARE_NEGATIVE_REGEX = re.compile(r'\b(?<!is\s)(not)\s+[^][)(}{ ]+\s+'
144+
r'(in|is)\s')
145145
COMPARE_TYPE_REGEX = re.compile(r'(?:[=!]=|is(?:\s+not)?)\s+type(?:s.\w+Type'
146146
r'|\s*\(\s*([^)]*[^ )])\s*\))')
147147
KEYWORD_REGEX = re.compile(r'(\s*)\b(?:%s)\b(\s*)' % r'|'.join(KEYWORDS))

testsuite/E71.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
#: E714
6868
if not X is Y is not Z:
6969
pass
70+
#: E714
71+
if not X is not Y:
72+
pass
7073

7174
#
7275
#: Okay

0 commit comments

Comments
 (0)