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 @@ -208,13 +208,14 @@ For convenience, some of these functions will always return a
208
208
209
209
.. c :function :: PyObject* PyErr_SetFromWindowsErr (int ierr)
210
210
211
- This is a convenience function to raise :exc:`WindowsError `. If called with
211
+ This is a convenience function to raise :exc:`OSError `. If called with
212
212
*ierr* of ``0``, the error code returned by a call to :c:func:`!GetLastError`
213
213
is used instead. It calls the Win32 function :c:func:`!FormatMessage` to retrieve
214
214
the Windows description of error code given by *ierr* or :c:func:`!GetLastError`,
215
- then it constructs a tuple object whose first item is the *ierr* value and whose
216
- second item is the corresponding error message (gotten from
217
- :c:func: `!FormatMessage `), and then calls ``PyErr_SetObject(PyExc_WindowsError,
215
+ then it constructs a :exc:`OSError` object with the :attr:`~OSError.winerror`
216
+ attribute set to the error code, the :attr:`~OSError.strerror` attribute
217
+ set to the corresponding error message (gotten from
218
+ :c:func: `!FormatMessage `), and then calls ``PyErr_SetObject(PyExc_OSError,
218
219
object)``. This function always returns ``NULL``.
219
220
220
221
.. availability:: Windows.
You can’t perform that action at this time.
0 commit comments