Skip to content

Commit 0919b1b

Browse files
authored
Merge pull request #22332 from compnerd/long-long-long
utils: adjust to support long paths on windows
2 parents e5a5ec4 + bc8aa4b commit 0919b1b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

utils/jobstats/jobstats.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import itertools
2020
import json
2121
import os
22+
import platform
2223
import random
2324
import re
2425

@@ -315,7 +316,13 @@ def load_stats_dir(path, select_module=[], select_stat=[],
315316
continue
316317
jobargs = [mg["input"], mg["triple"], mg["out"], mg["opt"]]
317318

318-
with open(os.path.join(root, f)) as fp:
319+
if platform.system() == 'Windows':
320+
p = unicode(u"\\\\?\\%s" % os.path.abspath(os.path.join(root,
321+
f)))
322+
else:
323+
p = os.path.join(root, f)
324+
325+
with open(p) as fp:
319326
j = json.load(fp)
320327
dur_usec = 1
321328
stats = dict()

0 commit comments

Comments
 (0)