diff options
author | Anthony Sottile <asottile@umich.edu> | 2021-10-05 15:42:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-05 15:42:55 -0700 |
commit | 174ec0231955ba99cc2fdf48e61064b3f95c959c (patch) | |
tree | 14a0c77179f5e589f21240abf86f9f6e0c20bcd0 /pycodestyle.py | |
parent | 7046878584b5e7fb08ad3317505285957eb0cbc1 (diff) | |
parent | 696170927b2723ce390d011d5d1af34e914e61b8 (diff) | |
download | pep8-174ec0231955ba99cc2fdf48e61064b3f95c959c.tar.gz |
Merge pull request #1003 from cdce8p/e225-star-pattern
Fix false-positive with star pattern
Diffstat (limited to 'pycodestyle.py')
-rwxr-xr-x | pycodestyle.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pycodestyle.py b/pycodestyle.py index 1d98dce..cc1720e 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -965,8 +965,13 @@ def missing_whitespace_around_operator(logical_line, tokens): # Check if the operator is used as a binary operator # Allow unary operators: -123, -x, +1. # Allow argument unpacking: foo(*args, **kwargs). - if (prev_text in '}])' if prev_type == tokenize.OP - else prev_text not in KEYWORDS): + if prev_type == tokenize.OP and prev_text in '}])' or ( + prev_type != tokenize.OP and + prev_text not in KEYWORDS and ( + sys.version_info < (3, 9) or + not keyword.issoftkeyword(prev_text) + ) + ): need_space = None elif text in WS_OPTIONAL_OPERATORS: need_space = None |