Skip to content

Commit 8da64fb

Browse files
otethaltimfel
authored andcommitted
Fix list_files on Windows and clear GRAAL_PYTHON_ARGS in graalpy.cmd
(cherry picked from commit d2473b5)
1 parent 1194f65 commit 8da64fb

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/GraalPythonModuleBuiltins.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ private static Set<String> list(TruffleFile dir, TruffleFile rd) throws IOExcept
10531053
// add dir
10541054
TruffleFile rootDir = rd == null ? dir : rd;
10551055
String rootPath = makeDirPath(rootDir.getAbsoluteFile().getPath());
1056-
int rootEndIdx = rootPath.lastIndexOf("/", rootPath.lastIndexOf("/") - 1);
1056+
int rootEndIdx = rootPath.lastIndexOf(File.separator, rootPath.lastIndexOf(File.separator) - 1);
10571057
ret.add(dirPath.substring(rootEndIdx));
10581058

10591059
// add parents up to root
@@ -1079,8 +1079,8 @@ private static Set<String> list(TruffleFile dir, TruffleFile rd) throws IOExcept
10791079
}
10801080

10811081
private static String makeDirPath(String p) {
1082-
if (!p.endsWith("/")) {
1083-
p = p + "/";
1082+
if (!p.endsWith(File.separator)) {
1083+
p = p + File.separator;
10841084
}
10851085
return p;
10861086
}

graalpython/lib-graalpython/modules/standalone/app/graalpy.cmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ for /f "delims=" %%i in ('%JAVA% VTabCreator.java') do set VTAB=%%i
1414
del VTabCreator.java
1515

1616
REM Store each argument separated by vtab
17+
set GRAAL_PYTHON_ARGS=
1718
:loop
1819
set GRAAL_PYTHON_ARGS=%GRAAL_PYTHON_ARGS%%VTAB%%~1
1920
shift /1

0 commit comments

Comments
 (0)