Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 557a044 commit 33a6da9Copy full SHA for 33a6da9
1 file changed
Modules/posixmodule.c
@@ -349,12 +349,16 @@ posix_error_with_filename(char* name)
349
static PyObject *
350
win32_error(char* function, char* filename)
351
{
352
- /* XXX this could be improved */
+ /* XXX We should pass the function name along in the future.
353
+ (_winreg.c also wants to pass the function name.)
354
+ This would however require an additional param to the
355
+ Windows error object, which is non-trivial.
356
+ */
357
errno = GetLastError();
358
if (filename)
- return PyErr_SetFromErrnoWithFilename(PyExc_OSError, filename);
359
+ return PyErr_SetFromWindowsErrWithFilename(errno, filename);
360
else
- return PyErr_SetFromErrno(PyExc_OSError);
361
+ return PyErr_SetFromWindowsErr(errno);
362
}
363
#endif
364
0 commit comments