Mercurial > cpython-lru_cache-weakref
diff Python/bltinmodule.c @ 20654:edd9d0b3c47e legacy-trunk
SF patch #474590 -- RISC OS support
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 24 Oct 2001 20:42:55 +0000 |
| parents | bbdc0abfbb13 |
| children | 272336648d1f |
line wrap: on
line diff
--- a/Python/bltinmodule.c Wed Oct 24 20:22:40 2001 +0000 +++ b/Python/bltinmodule.c Wed Oct 24 20:42:55 2001 +0000 @@ -13,6 +13,10 @@ #include <unistd.h> #endif +#ifdef RISCOS +#include "unixstuff.h" +#endif + /* The default encoding used by the platform file system APIs Can remain NULL for all platforms that don't have such a concept */ @@ -536,7 +540,9 @@ FILE* fp = NULL; PyCompilerFlags cf; int exists; +#ifndef RISCOS struct stat s; +#endif if (!PyArg_ParseTuple(args, "s|O!O!:execfile", &filename, @@ -558,12 +564,21 @@ exists = 0; /* Test for existence or directory. */ +#ifndef RISCOS if (!stat(filename, &s)) { if (S_ISDIR(s.st_mode)) errno = EISDIR; else exists = 1; } +#else + if (object_exists(filename)) { + if (isdir(filename)) + errno = EISDIR; + else + exists = 1; + } +#endif /* RISCOS */ if (exists) { Py_BEGIN_ALLOW_THREADS
