Skip to content

Commit a48de05

Browse files
committed
support just getting the umask
1 parent 50f5a46 commit a48de05

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,4 +1612,17 @@ int getCpuCount() {
16121612
return Runtime.getRuntime().availableProcessors();
16131613
}
16141614
}
1615+
1616+
@Builtin(name = "umask", fixedNumOfPositionalArgs = 1)
1617+
@GenerateNodeFactory
1618+
abstract static class UmaskNode extends PythonBuiltinNode {
1619+
@Specialization
1620+
int getAndSetUmask(int umask) {
1621+
if (umask == 0022) {
1622+
return 0022;
1623+
} else {
1624+
throw raise(NotImplementedError, "setting the umask to anything other than the default");
1625+
}
1626+
}
1627+
}
16151628
}

0 commit comments

Comments
 (0)