summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-10-24 20:42:55 (GMT)
committerGuido van Rossum <guido@python.org>2001-10-24 20:42:55 (GMT)
commite2ae77b8b8a62e648bb1864a9b36ef3280984404 (patch)
treee03ad6f126a16529b2fb43671903e357bcb05835 /Python/bltinmodule.c
parentc6ac8a78f668123ec5c2c3d5a824e7886e9a1c60 (diff)
downloadcpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.zip
cpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.tar.gz
cpython-e2ae77b8b8a62e648bb1864a9b36ef3280984404.tar.bz2
SF patch #474590 -- RISC OS support
Diffstat (limited to 'Python/bltinmodule.c')
-rw-r--r--Python/bltinmodule.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 144a62f..ac2aa5a 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -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 @@ builtin_execfile(PyObject *self, PyObject *args)
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 @@ builtin_execfile(PyObject *self, PyObject *args)
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