diff options
author | shadchin <shadchin@yandex-team.com> | 2023-10-03 23:32:21 +0300 |
---|---|---|
committer | shadchin <shadchin@yandex-team.com> | 2023-10-03 23:48:51 +0300 |
commit | 01ffd024041ac933854c367fb8d1b5682d19883f (patch) | |
tree | b70aa497ba132a133ccece49f7763427dcd0743f /contrib/tools/python3/src/Python/fileutils.c | |
parent | a33fdb9a34581fd124e92535153b1f1fdeca6aaf (diff) | |
download | ydb-01ffd024041ac933854c367fb8d1b5682d19883f.tar.gz |
Update Python 3 to 3.11.6
Diffstat (limited to 'contrib/tools/python3/src/Python/fileutils.c')
-rw-r--r-- | contrib/tools/python3/src/Python/fileutils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/tools/python3/src/Python/fileutils.c b/contrib/tools/python3/src/Python/fileutils.c index e1af39ddf0..79ce20bd72 100644 --- a/contrib/tools/python3/src/Python/fileutils.c +++ b/contrib/tools/python3/src/Python/fileutils.c @@ -1687,6 +1687,7 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_END_ALLOW_THREADS } while (f == NULL && errno == EINTR && !(async_err = PyErr_CheckSignals())); + int saved_errno = errno; #if !USE_UNICODE_WCHAR_CACHE PyMem_Free(wpath); #endif /* USE_UNICODE_WCHAR_CACHE */ @@ -1711,13 +1712,14 @@ _Py_fopen_obj(PyObject *path, const char *mode) Py_END_ALLOW_THREADS } while (f == NULL && errno == EINTR && !(async_err = PyErr_CheckSignals())); - + int saved_errno = errno; Py_DECREF(bytes); #endif if (async_err) return NULL; if (f == NULL) { + errno = saved_errno; PyErr_SetFromErrnoWithFilenameObject(PyExc_OSError, path); return NULL; } |