Skip to content

Commit 0678aa6

Browse files
authored
Merge pull request swiftlang#30911 from compnerd/long-paths
test: support long paths in `rewrite-module-triples`
2 parents 3946599 + f46492f commit 0678aa6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/CrossImport/Inputs/rewrite-module-triples.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from __future__ import print_function
88

99
import os
10+
import platform
1011
import shutil
1112
import sys
1213

@@ -36,7 +37,11 @@ def rewrite(parent, names, copy_fn, rm_fn):
3637

3738
for new_name in new_names:
3839
new_path = os.path.join(parent, new_name)
39-
copy_fn(path, new_path)
40+
if platform.system() == 'Windows':
41+
copy_fn(u'\\'.join([u'\\\\?', os.path.normpath(path)]),
42+
u'\\'.join([u'\\\\?', os.path.normpath(new_path)]))
43+
else:
44+
copy_fn(path, new_path)
4045

4146
rm_fn(path)
4247

0 commit comments

Comments
 (0)