diff --git a/pycodestyle.py b/pycodestyle.py index f5e05cfa..4a973724 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -2010,6 +2010,11 @@ def build_tokens_line(self): continue if token_type == tokenize.STRING: text = mute_string(text) + elif ( + sys.version_info >= (3, 12) and + token_type == tokenize.FSTRING_MIDDLE + ): + text = 'x' * len(text) if prev_row: (start_row, start_col) = start if prev_row != start_row: # different row diff --git a/testsuite/python36.py b/testsuite/python36.py new file mode 100644 index 00000000..94ec2dc5 --- /dev/null +++ b/testsuite/python36.py @@ -0,0 +1,2 @@ +#: Okay +f'{hello}:{world}'