Skip to content

Commit 0d5aa7f

Browse files
Fix non-glob paths in touch.py
1 parent 6308cd0 commit 0d5aa7f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/Driver/Dependencies/Inputs/touch.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626
# From http://stackoverflow.com/a/1160227.
2727
for filePathPattern in sys.argv[2:]:
2828
# Support glob patterns if the shell did not expand them (like cmd.exe)
29-
for filePath in glob.glob(filePathPattern):
29+
if glob.escape(filePathPattern) == filePathPattern:
30+
# Not a glob pattern. We should touch that specific file.
31+
filePaths = [ filePathPattern ]
32+
else:
33+
filePaths = glob.glob(filePathPattern)
34+
35+
for filePath in filePaths:
3036
with open(filePath, 'a'):
3137
os.utime(filePath, (timeVal, timeVal))

0 commit comments

Comments
 (0)