From ed189ce49423f15ba8774ff174c15d03d12bc807 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 11 Oct 2019 17:36:56 +0200 Subject: bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) (GH-16719) pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively. (cherry picked from commit 2b7dc40b2af6578181808ba73c1533fc114e55df) --- Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst | 1 + Tools/scripts/pathfix.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst diff --git a/Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst b/Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst new file mode 100644 index 0000000..ae64a31 --- /dev/null +++ b/Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst @@ -0,0 +1 @@ +pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively. diff --git a/Tools/scripts/pathfix.py b/Tools/scripts/pathfix.py index c5bf984..28ee428 100755 --- a/Tools/scripts/pathfix.py +++ b/Tools/scripts/pathfix.py @@ -70,9 +70,9 @@ def main(): if fix(arg): bad = 1 sys.exit(bad) -ispythonprog = re.compile(r'^[a-zA-Z0-9_]+\.py$') + def ispython(name): - return bool(ispythonprog.match(name)) + return name.endswith('.py') def recursedown(dirname): dbg('recursedown(%r)\n' % (dirname,)) -- cgit v0.12