Skip to content

Commit c4ca958

Browse files
committed
Fix E231 false-positive on Python 3.12
Ported PyCQA/pycodestyle#1148
1 parent 62e6f67 commit c4ca958

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/roslint/pycodestyle.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,6 +2011,11 @@ def build_tokens_line(self):
20112011
continue
20122012
if token_type == tokenize.STRING:
20132013
text = mute_string(text)
2014+
elif (
2015+
sys.version_info >= (3, 12) and
2016+
token_type == tokenize.FSTRING_MIDDLE
2017+
):
2018+
text = 'x' * len(text)
20142019
if prev_row:
20152020
(start_row, start_col) = start
20162021
if prev_row != start_row: # different row

0 commit comments

Comments
 (0)