[Python-checkins] bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536) (GH-16719)

Victor Stinner webhook-mailer at python.org
Fri Oct 11 11:37:10 EDT 2019


https://github.com/python/cpython/commit/ed189ce49423f15ba8774ff174c15d03d12bc807
commit: ed189ce49423f15ba8774ff174c15d03d12bc807
branch: 3.7
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2019-10-11T17:36:56+02:00
summary:

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)

files:
A Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst
M 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
index 0000000000000..ae64a319b5756
--- /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 c5bf984306a35..28ee428a3a1d8 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,))



More information about the Python-checkins mailing list