From: Victor Stinner Date: Fri, 11 Oct 2019 15:36:56 +0000 (+0200) Subject: bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) (GH... X-Git-Tag: v3.7.6rc1~111 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed189ce49423f15ba8774ff174c15d03d12bc807;p=thirdparty%2FPython%2Fcpython.git 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) --- 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 000000000000..ae64a319b575 --- /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 c5bf984306a3..28ee428a3a1d 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,))