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 00000000000000..ae64a319b57560 --- /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 c5bf984306a35b..28ee428a3a1d85 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,))