]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) (GH...
authorVictor Stinner <vstinner@python.org>
Fri, 11 Oct 2019 15:36:56 +0000 (17:36 +0200)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2019 15:36:56 +0000 (17:36 +0200)
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 [new file with mode: 0644]
Tools/scripts/pathfix.py

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 (file)
index 0000000..ae64a31
--- /dev/null
@@ -0,0 +1 @@
+pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
index c5bf984306a35bfa4cc9132e02224034733caac7..28ee428a3a1d85a0d9a6855c2bef826da7057ecd 100755 (executable)
@@ -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,))