File tree 1 file changed +5
-4
lines changed 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -221,13 +221,14 @@ For convenience, some of these functions will always return a
221
221
222
222
.. c :function :: PyObject* PyErr_SetFromWindowsErr (int ierr)
223
223
224
- This is a convenience function to raise :exc:`WindowsError `. If called with
224
+ This is a convenience function to raise :exc:`OSError `. If called with
225
225
*ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError`
226
226
is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve
227
227
the Windows description of error code given by *ierr* or :c:func:`!GetLastError`,
228
- then it constructs a tuple object whose first item is the *ierr* value and whose
229
- second item is the corresponding error message (gotten from
230
- :c:func: `!FormatMessage `), and then calls ``PyErr_SetObject(PyExc_WindowsError,
228
+ then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror`
229
+ attribute set to the error code, the :attr:`~OSError.strerror` attribute
230
+ set to the corresponding error message (gotten from
231
+ :c:func: `!FormatMessage `), and then calls ``PyErr_SetObject(PyExc_OSError,
231
232
object)``. This function always returns ``NULL``.
232
233
233
234
.. availability:: Windows.
You can’t perform that action at this time.
0 commit comments