diff options
author | Anthony Sottile <asottile@umich.edu> | 2021-04-02 19:20:28 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 19:20:28 -0700 |
commit | c4460cb9dffbd9b7ee000dc31388d5f45fe484a0 (patch) | |
tree | 8174b1430b252369802cecb90abe8bc6851fda4e /pycodestyle.py | |
parent | 76edc0afe5ea95f09aaef17c11c9d26ac0729ac9 (diff) | |
parent | 37e96aa5355e85e60c1003b1e85f6e29bcb8e20b (diff) | |
download | pep8-c4460cb9dffbd9b7ee000dc31388d5f45fe484a0.tar.gz |
Merge pull request #987 from asottile/E712_multiple_times
detect multiple E712 in a line
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-x | pycodestyle.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index f5d2f89..c091639 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -1393,8 +1393,10 @@ def comparison_to_singleton(logical_line, noqa): None was set to some other value. The other value might have a type (such as a container) that could be false in a boolean context! """ - match = not noqa and COMPARE_SINGLETON_REGEX.search(logical_line) - if match: + if noqa: + return + + for match in COMPARE_SINGLETON_REGEX.finditer(logical_line): singleton = match.group(1) or match.group(3) same = (match.group(2) == '==') |