mirror of
https://github.com/python/cpython.git
synced 2026-01-06 23:42:34 +00:00
Issue #23694: Enhance _Py_open(), it now raises exceptions
* _Py_open() now raises exceptions on error. If open() fails, it raises an OSError with the filename. * _Py_open() now releases the GIL while calling open() * Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not held
This commit is contained in:
parent
6562b29e13
commit
a555cfcb73
8 changed files with 71 additions and 45 deletions
|
|
@ -1221,7 +1221,6 @@ new_mmap_object(PyTypeObject *type, PyObject *args, PyObject *kwdict)
|
|||
fd = devzero = _Py_open("/dev/zero", O_RDWR);
|
||||
if (devzero == -1) {
|
||||
Py_DECREF(m_obj);
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue