Skip to content

Commit 9764fd0

Browse files
committed
Handle long in OpenNode
1 parent d13dfb9 commit 9764fd0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -930,17 +930,17 @@ public abstract static class OpenNode extends PythonFileNode {
930930
private final BranchProfile gotException = BranchProfile.create();
931931

932932
@Specialization(guards = {"isNoValue(mode)", "isNoValue(dir_fd)"})
933-
Object open(VirtualFrame frame, Object pathname, int flags, @SuppressWarnings("unused") PNone mode, PNone dir_fd,
933+
Object open(VirtualFrame frame, Object pathname, long flags, @SuppressWarnings("unused") PNone mode, PNone dir_fd,
934934
@Cached CastToPathNode cast) {
935935
return openMode(frame, pathname, flags, 0777, dir_fd, cast);
936936
}
937937

938938
@Specialization(guards = {"isNoValue(dir_fd)"})
939-
Object openMode(VirtualFrame frame, Object pathArg, int flags, int fileMode, @SuppressWarnings("unused") PNone dir_fd,
939+
Object openMode(VirtualFrame frame, Object pathArg, long flags, long fileMode, @SuppressWarnings("unused") PNone dir_fd,
940940
@Cached CastToPathNode cast) {
941941
String pathname = cast.execute(frame, pathArg);
942-
Set<StandardOpenOption> options = flagsToOptions(flags);
943-
FileAttribute<Set<PosixFilePermission>>[] attributes = modeToAttributes(fileMode);
942+
Set<StandardOpenOption> options = flagsToOptions((int) flags);
943+
FileAttribute<Set<PosixFilePermission>>[] attributes = modeToAttributes((int) fileMode);
944944
try {
945945
SeekableByteChannel fc;
946946
TruffleFile truffleFile = getContext().getPublicTruffleFileRelaxed(pathname, PythonLanguage.DEFAULT_PYTHON_EXTENSIONS);

0 commit comments

Comments
 (0)