|
26 | 26 | package com.oracle.graal.python.builtins.modules;
|
27 | 27 |
|
28 | 28 | import static com.oracle.graal.python.nodes.SpecialMethodNames.__FSPATH__;
|
| 29 | +import static com.oracle.graal.python.runtime.exception.PythonErrorType.FileNotFoundError; |
29 | 30 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.NotImplementedError;
|
30 | 31 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.OSError;
|
31 | 32 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
|
@@ -333,6 +334,11 @@ Object fstatPInt(PInt fd,
|
333 | 334 | return recursive.executeWith(fd.intValue());
|
334 | 335 | }
|
335 | 336 |
|
| 337 | + @Fallback |
| 338 | + Object doGeneric(Object o) { |
| 339 | + throw raise(TypeError, "an integer is required (got type %p)", o); |
| 340 | + } |
| 341 | + |
336 | 342 | protected static StatNode createStatNode() {
|
337 | 343 | return StatNode.create();
|
338 | 344 | }
|
@@ -392,7 +398,7 @@ Object stat(String path, boolean followSymlinks) {
|
392 | 398 | TruffleFile f = getContext().getEnv().getTruffleFile(path);
|
393 | 399 | LinkOption[] linkOptions = followSymlinks ? new LinkOption[0] : new LinkOption[]{LinkOption.NOFOLLOW_LINKS};
|
394 | 400 | if (!f.exists(linkOptions)) {
|
395 |
| - throw raise(OSError, "No such file or directory: '%s'", path); |
| 401 | + throw raise(FileNotFoundError, "No such file or directory: '%s'", path); |
396 | 402 | }
|
397 | 403 | int mode = 0;
|
398 | 404 | long size = 0;
|
@@ -969,6 +975,7 @@ class StreamGobbler extends Thread {
|
969 | 975 | }
|
970 | 976 |
|
971 | 977 | @Override
|
| 978 | + @TruffleBoundary |
972 | 979 | public void run() {
|
973 | 980 | try {
|
974 | 981 | InputStreamReader isr = new InputStreamReader(is);
|
|
0 commit comments