Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ed189ce

Browse files
authored
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 2b7dc40)
1 parent 08afed7 commit ed189ce

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.

Tools/scripts/pathfix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ def main():
7070
if fix(arg): bad = 1
7171
sys.exit(bad)
7272

73-
ispythonprog = re.compile(r'^[a-zA-Z0-9_]+\.py$')
73+
7474
def ispython(name):
75-
return bool(ispythonprog.match(name))
75+
return name.endswith('.py')
7676

7777
def recursedown(dirname):
7878
dbg('recursedown(%r)\n' % (dirname,))

0 commit comments

Comments
 (0)