Skip to content

Commit

Permalink
Merge pull request #1207 from PyCQA/fstring-keyword-part
Browse files Browse the repository at this point in the history
fix 3.12 false positive when fstring chunk is a keyword
  • Loading branch information
asottile authored Oct 12, 2023
2 parents 8394fa2 + 0c5e01a commit 73b2700
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ def missing_whitespace_after_keyword(logical_line, tokens):
# appear e.g. as "if x is None:", and async/await, which were
# valid identifier names in old Python versions.
if (tok0.end == tok1.start and
tok0.type == tokenize.NAME and
keyword.iskeyword(tok0.string) and
tok0.string not in SINGLETONS and
not (tok0.string == 'except' and tok1.string == '*') and
Expand Down
1 change: 1 addition & 0 deletions testing/data/python36.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#: Okay
f'{hello}:{world}'
f'in{x}'

0 comments on commit 73b2700

Please sign in to comment.