Skip to content

Commit c32ba54

Browse files
committed
Remove unwanted exports from posix module
1 parent a4836b1 commit c32ba54

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ public PosixModuleBuiltins() {
256256
builtinConstants.put("O_SYNC", SYNC);
257257
builtinConstants.put("O_TEMPORARY", TEMPORARY);
258258
builtinConstants.put("O_TMPFILE", TMPFILE);
259-
builtinConstants.put("SEEK_SET", SEEK_SET);
260-
builtinConstants.put("SEEK_CUR", SEEK_CUR);
261-
builtinConstants.put("SEEK_END", SEEK_END);
262259

263260
builtinConstants.put("WNOHANG", WNOHANG);
264261
builtinConstants.put("WUNTRACED", WUNTRACED);

graalpython/lib-graalpython/_io.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
_warn = sys.modules["_warnings"].warn
2626
_os = sys.modules.get("posix", sys.modules.get("nt"))
2727

28+
SEEK_SET = 0
29+
SEEK_CUR = 1
30+
SEEK_END = 2
2831

2932
DEFAULT_BUFFER_SIZE = 8192
3033

@@ -363,7 +366,7 @@ def __init__(self, name, mode='r', closefd=True, opener=None):
363366
if self.__appending__:
364367
# For consistent behaviour, we explicitly seek to the end of file
365368
# (otherwise, it might be done only on the first write()).
366-
_os.lseek(self.__fd__, 0, _os.SEEK_END)
369+
_os.lseek(self.__fd__, 0, SEEK_END)
367370
except:
368371
if not fd_is_own:
369372
self.__fd__ = -1
@@ -451,7 +454,7 @@ def seekable(self):
451454
self._checkClosed()
452455
if self.__seekable__ < 0:
453456
try:
454-
_os.lseek(self.__fd__, 0, _os.SEEK_CUR)
457+
_os.lseek(self.__fd__, 0, SEEK_CUR)
455458
except OSError:
456459
self.__seekable__ = 0
457460
else:

graalpython/lib-graalpython/posix.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,3 @@ def uname():
152152
@__graalpython__.builtin
153153
def get_terminal_size(fd = None):
154154
return terminal_size(old_get_terminal_size(fd))
155-
156-
def execl(file, *args):
157-
"""execl(file, *args)
158-
Execute the executable file with argument list args, replacing the
159-
current process. """
160-
execv(file, args)

0 commit comments

Comments
 (0)