diff options
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/fileobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 27612f4..9af5ca9 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -1025,6 +1025,8 @@ file_xreadlines(PyFileObject *f) { static PyObject* xreadlines_function = NULL; + if (f->f_fp == NULL) + return err_closed(); if (!xreadlines_function) { PyObject *xreadlines_module = PyImport_ImportModule("xreadlines"); |