handle = (HANDLE)_get_osfhandle(fd);
if (handle == INVALID_HANDLE_VALUE) {
if (raise)
- PyErr_SetFromWindowsErr(0);
+ PyErr_SetFromErrno(PyExc_OSError);
return -1;
}
if (atomic_flag_works != NULL && !inheritable) {
if (*atomic_flag_works == -1) {
- int inheritable = get_inheritable(fd, raise);
- if (inheritable == -1)
+ int isInheritable = get_inheritable(fd, raise);
+ if (isInheritable == -1)
return -1;
- *atomic_flag_works = !inheritable;
+ *atomic_flag_works = !isInheritable;
}
if (*atomic_flag_works)
handle = (HANDLE)_get_osfhandle(fd);
if (handle == INVALID_HANDLE_VALUE) {
if (raise)
- PyErr_SetFromWindowsErr(0);
+ PyErr_SetFromErrno(PyExc_OSError);
return -1;
}
#ifdef MS_WINDOWS
handle = (HANDLE)_get_osfhandle(fd);
if (handle == INVALID_HANDLE_VALUE) {
- PyErr_SetFromWindowsErr(0);
+ PyErr_SetFromErrno(PyExc_OSError);
return -1;
}