mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Issue #16719: Get rid of WindowsError. Use OSError instead
Patch by Serhiy Storchaka.
This commit is contained in:
parent
8a045cb93b
commit
2606a6f197
28 changed files with 79 additions and 87 deletions
|
@ -588,7 +588,7 @@ PyObject *PyErr_SetExcFromWindowsErr(PyObject *exc, int ierr)
|
|||
|
||||
PyObject *PyErr_SetFromWindowsErr(int ierr)
|
||||
{
|
||||
return PyErr_SetExcFromWindowsErrWithFilename(PyExc_WindowsError,
|
||||
return PyErr_SetExcFromWindowsErrWithFilename(PyExc_OSError,
|
||||
ierr, NULL);
|
||||
}
|
||||
PyObject *PyErr_SetFromWindowsErrWithFilename(
|
||||
|
@ -597,7 +597,7 @@ PyObject *PyErr_SetFromWindowsErrWithFilename(
|
|||
{
|
||||
PyObject *name = filename ? PyUnicode_DecodeFSDefault(filename) : NULL;
|
||||
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
|
||||
PyExc_WindowsError,
|
||||
PyExc_OSError,
|
||||
ierr, name);
|
||||
Py_XDECREF(name);
|
||||
return result;
|
||||
|
@ -611,7 +611,7 @@ PyObject *PyErr_SetFromWindowsErrWithUnicodeFilename(
|
|||
PyUnicode_FromUnicode(filename, wcslen(filename)) :
|
||||
NULL;
|
||||
PyObject *result = PyErr_SetExcFromWindowsErrWithFilenameObject(
|
||||
PyExc_WindowsError,
|
||||
PyExc_OSError,
|
||||
ierr, name);
|
||||
Py_XDECREF(name);
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue