Skip to content

Commit 150f3fd

Browse files
author
Sauyon Lee
committed
improve windows compatibility
1 parent 5d716b9 commit 150f3fd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

java/ql/src/utils/makeStubs.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ def print_usage(exit_code=1):
3030
if len(sys.argv) not in [3, 4]:
3131
print_usage()
3232

33-
testDir = sys.argv[1].rstrip("/")
34-
stubDir = sys.argv[2].rstrip("/")
33+
testDir = os.path.normpath(sys.argv[1])
34+
stubDir = os.path.normpath(sys.argv[2])
3535

3636
def check_dir_exists(path):
3737
if not os.path.isdir(path):
@@ -155,7 +155,7 @@ def run(cmd):
155155
f"WARNING: Multiple stubs generated for {typ}. This is probably a bug. One will be chosen arbitrarily.")
156156

157157
for (typ, stub) in results['#select']['tuples']:
158-
stubFile = os.path.join(stubDir, typ.replace(".", "/") + ".java")
158+
stubFile = os.path.join(stubDir, *typ.split(".")) + ".java"
159159
os.makedirs(os.path.dirname(stubFile), exist_ok=True)
160160
with open(stubFile, "w") as f:
161161
f.write(stub)

0 commit comments

Comments
 (0)