diff --git a/0001-backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch b/0001-backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch new file mode 100644 index 0000000000000000000000000000000000000000..a76dbb511d39d2d0d35e5756edf52ba85f7f1831 --- /dev/null +++ b/0001-backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch @@ -0,0 +1,34 @@ +From 0c5e01a41d86ca30385622948252f350878921c1 Mon Sep 17 00:00:00 2001 +From: Anthony Sottile +Date: Thu, 12 Oct 2023 09:19:56 -0400 +Subject: [PATCH] fix 3.12 false positive when fstring chunk is a keyword + +Reference: https://github.com/PyCQA/pycodestyle/commit/0c5e01a41d86ca30385622948252f350878921c1 +--- + pycodestyle.py | 1 + + testing/data/python36.py | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/pycodestyle.py b/pycodestyle.py +index c492436..18514f0 100755 +--- a/pycodestyle.py ++++ b/pycodestyle.py +@@ -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 +diff --git a/testing/data/python36.py b/testing/data/python36.py +index 94ec2dc..aefd654 100644 +--- a/testing/data/python36.py ++++ b/testing/data/python36.py +@@ -1,2 +1,3 @@ + #: Okay + f'{hello}:{world}' ++f'in{x}' +-- +2.18.2 + diff --git a/python-pycodestyle.spec b/python-pycodestyle.spec index ad16b9ba168c32a3939ebc8ca34b4e6b12ef08f2..ce5ab3785632771503188cdaca90482daa132593 100644 --- a/python-pycodestyle.spec +++ b/python-pycodestyle.spec @@ -1,11 +1,14 @@ %global _empty_manifest_terminate_build 0 Name: python-pycodestyle Version: 2.11.1 -Release: 1 +Release: 2 Summary: Python style guide checker License: GPLv2+ Url: https://github.com/PyCQA/pycodestyle Source0: https://github.com/PyCQA/pycodestyle/archive/%{version}.tar.gz + +Patch0001: 0001-backport-fix-3.12-false-positive-when-fstring-chunk-is-a-keyword.patch + BuildArch: noarch %description pycodestyle (formerly pep8) is a tool to check your Python code against some of the style conventions in PEP 8. @@ -64,6 +67,9 @@ mv %{buildroot}/filelist.lst . %{_docdir}/* %changelog +* Fri May 10 2024 lixiaoyong - 2.11.1-2 +- fix 3.12 false positive when fstring chunk is a keyword + * Mon Apr 22 2024 lilong - 2.11.1-1 - Update package to version 2.11.1