mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Enable new I/O. Disable creation of old files.
Lots of stuff fails now, including -S and -m command line flags.
This commit is contained in:
parent
fa0054aa73
commit
6f376c4031
4 changed files with 11 additions and 73 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue