summaryrefslogtreecommitdiffstats
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-24 14:31:33 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-24 14:31:33 (GMT)
commit6f376c40317e693c5eea0356fbb90d7394f21ff0 (patch)
treeb787fddfb1173c1045d3c9e622b255754ab5eb49 /Objects/fileobject.c
parentfa0054aa732176a1f9b1c79cd20198f43cfed334 (diff)
downloadcpython-6f376c40317e693c5eea0356fbb90d7394f21ff0.zip
cpython-6f376c40317e693c5eea0356fbb90d7394f21ff0.tar.gz
cpython-6f376c40317e693c5eea0356fbb90d7394f21ff0.tar.bz2
Enable new I/O. Disable creation of old files.
Lots of stuff fails now, including -S and -m command line flags.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r--Objects/fileobject.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 7c8e2b2..469eacd 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -265,6 +265,10 @@ cleanup:
PyObject *
PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE *))
{
+ PyErr_SetString(PyExc_SystemError,
+ "attempt to create old file from FILE *");
+ return NULL;
+#if 0
PyFileObject *f = (PyFileObject *)PyFile_Type.tp_new(&PyFile_Type,
NULL, NULL);
if (f != NULL) {
@@ -278,6 +282,7 @@ PyFile_FromFile(FILE *fp, char *name, char *mode, int (*close)(FILE *))
Py_DECREF(o_name);
}
return (PyObject *) f;
+#endif
}
PyObject *
@@ -1941,6 +1946,9 @@ file_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *self;
static PyObject *not_yet_string;
+ PyErr_SetString(PyExc_SystemError, "attempt to create old file");
+ return NULL;
+
assert(type != NULL && type->tp_alloc != NULL);
if (not_yet_string == NULL) {