diff options
author | Victor Stinner <vstinner@python.org> | 2019-10-11 17:36:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-11 17:36:56 +0200 |
commit | ed189ce49423f15ba8774ff174c15d03d12bc807 (patch) | |
tree | e86dc21f4dfa986c3c5c552a44057ce2f0579cfd | |
parent | 08afed76051c1ae67a47b456f6b737d39bde0082 (diff) | |
download | cpython-git-ed189ce49423f15ba8774ff174c15d03d12bc807.tar.gz |
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)
-rw-r--r-- | Misc/NEWS.d/next/Tools-Demos/2019-10-02-09-48-42.bpo-38347.2Tq5D1.rst | 1 | ||||
-rwxr-xr-x | Tools/scripts/pathfix.py | 4 |
2 files changed, 3 insertions, 2 deletions
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 0000000000..ae64a319b5 --- /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 c5bf984306..28ee428a3a 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,)) |