From 658dada34b163db296346ef67e304d95b4df0aa8 Mon Sep 17 00:00:00 2001 From: anthony sottile Date: Tue, 22 Sep 2026 17:20:14 -0400 Subject: [PATCH] detect python3t and remove detection for python3m and pythonu --- pyflakes/api.py | 2 +- pyflakes/test/test_api.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyflakes/api.py b/pyflakes/api.py index cd4d9434..69d95139 100644 --- a/pyflakes/api.py +++ b/pyflakes/api.py @@ -12,7 +12,7 @@ __all__ = ['check', 'checkPath', 'checkRecursive', 'iterSourceCode', 'main'] -PYTHON_SHEBANG_REGEX = re.compile(br'^#!.*\bpython(3(\.\d+)?|w)?[dmu]?\s') +PYTHON_SHEBANG_REGEX = re.compile(br'^#!.*\bpython(3(\.\d+)?|w)?[dt]?\s') def check(codeString, filename, reporter=None): diff --git a/pyflakes/test/test_api.py b/pyflakes/test/test_api.py index d05dd968..b4e3bbbe 100644 --- a/pyflakes/test/test_api.py +++ b/pyflakes/test/test_api.py @@ -178,9 +178,9 @@ def test_shebang(self): with open(python3d, 'w') as fd: fd.write('#!/usr/local/bin/python3d\n') - python38m = os.path.join(self.tempdir, 'j') - with open(python38m, 'w') as fd: - fd.write('#! /usr/bin/env python3.8m\n') + python312t = os.path.join(self.tempdir, 'j') + with open(python312t, 'w') as fd: + fd.write('#! /usr/bin/env python3.12t\n') # Should NOT be treated as Python source notfirst = os.path.join(self.tempdir, 'l') @@ -191,7 +191,7 @@ def test_shebang(self): sorted(iterSourceCode([self.tempdir])), sorted([ python, python3, pythonw, python3args, python3d, - python38m, + python312t, ])) def test_multipleDirectories(self):