Skip to content

Commit 95016f3

Browse files
committed
[GR-23275] Make test___all__ pass
PullRequest: graalpython/1438
2 parents 5300577 + f2dc5e3 commit 95016f3

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/module/PosixTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ public void read() throws IOException {
133133
public void lseek() throws IOException {
134134
Files.write(tmpfile, "hello".getBytes());
135135
assertPrints("b'llo'\n", open("0") +
136-
"posix.lseek(fd, 2, posix.SEEK_SET)\n" +
136+
"import os\n" +
137+
"posix.lseek(fd, 2, os.SEEK_SET)\n" +
137138
"print(posix.read(fd, 3))");
138139
}
139140

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*graalpython.lib-python.3.test.test___all__.AllTest.test_all

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
@@ -257,9 +257,6 @@ public PosixModuleBuiltins() {
257257
builtinConstants.put("O_SYNC", SYNC);
258258
builtinConstants.put("O_TEMPORARY", TEMPORARY);
259259
builtinConstants.put("O_TMPFILE", TMPFILE);
260-
builtinConstants.put("SEEK_SET", SEEK_SET);
261-
builtinConstants.put("SEEK_CUR", SEEK_CUR);
262-
builtinConstants.put("SEEK_END", SEEK_END);
263260

264261
builtinConstants.put("WNOHANG", WNOHANG);
265262
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)

graalpython/lib-python/3/test/test___all__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def test_all(self):
7171
blacklist = set([
7272
# Will raise a SyntaxError when compiling the exec statement
7373
'__future__',
74+
# XXX Graalpython change: we don't have shared memory, so that module is missing SharedMemoryManager
75+
'multiprocessing.managers',
7476
])
7577

7678
if not sys.platform.startswith('java'):

0 commit comments

Comments
 (0)