Lines Matching refs:closed
55 "which are ignored) on a closed stream should raise a ValueError.\n"
62 "fp is closed after the suite of the with statement is complete:\n"
67 /* Use this macro whenever you want to check the internal `closed` status
68 of the IOBase object rather than the virtual `closed` attribute as returned
155 int closed = iobase_is_closed(self);
157 if (!closed) {
160 if (closed > 0) {
161 PyErr_SetString(PyExc_ValueError, "I/O operation on closed file.");
169 int closed = iobase_is_closed(self);
170 if (closed < 0) {
173 return PyBool_FromLong(closed);
180 int closed;
183 closed = _PyObject_LookupAttr(self, &_Py_ID(closed), &res);
184 if (closed > 0) {
185 closed = PyObject_IsTrue(res);
187 if (closed > 0) {
188 PyErr_SetString(PyExc_ValueError, "I/O operation on closed file.");
192 return closed;
216 This method has no effect if the file is already closed.
224 int rc, closed = iobase_is_closed(self);
226 if (closed < 0) {
229 if (closed) {
256 int closed;
261 /* If `closed` doesn't exist or can't be evaluated as bool, then the
263 if (_PyObject_LookupAttr(self, &_Py_ID(closed), &res) <= 0) {
265 closed = -1;
268 closed = PyObject_IsTrue(res);
270 if (closed == -1)
273 if (closed == 0) {
824 {"closed", (getter)iobase_closed_get, NULL, NULL},