@@ -614,9 +614,7 @@ _Py_fstat_noraise(int fd, struct _Py_stat_struct *status)
614614 HANDLE h ;
615615 int type ;
616616
617- _Py_BEGIN_SUPPRESS_IPH
618- h = (HANDLE )_get_osfhandle (fd );
619- _Py_END_SUPPRESS_IPH
617+ h = (HANDLE )_Py_get_osfhandle_noraise (fd );
620618
621619 if (h == INVALID_HANDLE_VALUE ) {
622620 /* errno is already set by _get_osfhandle, but we also set
@@ -739,9 +737,7 @@ get_inheritable(int fd, int raise)
739737 HANDLE handle ;
740738 DWORD flags ;
741739
742- _Py_BEGIN_SUPPRESS_IPH
743- handle = (HANDLE )_get_osfhandle (fd );
744- _Py_END_SUPPRESS_IPH
740+ handle = (HANDLE )_Py_get_osfhandle_noraise (fd );
745741 if (handle == INVALID_HANDLE_VALUE ) {
746742 if (raise )
747743 PyErr_SetFromErrno (PyExc_OSError );
@@ -810,9 +806,7 @@ set_inheritable(int fd, int inheritable, int raise, int *atomic_flag_works)
810806 }
811807
812808#ifdef MS_WINDOWS
813- _Py_BEGIN_SUPPRESS_IPH
814- handle = (HANDLE )_get_osfhandle (fd );
815- _Py_END_SUPPRESS_IPH
809+ handle = (HANDLE )_Py_get_osfhandle_noraise (fd );
816810 if (handle == INVALID_HANDLE_VALUE ) {
817811 if (raise )
818812 PyErr_SetFromErrno (PyExc_OSError );
@@ -1465,13 +1459,9 @@ _Py_dup(int fd)
14651459#endif
14661460
14671461#ifdef MS_WINDOWS
1468- _Py_BEGIN_SUPPRESS_IPH
1469- handle = (HANDLE )_get_osfhandle (fd );
1470- _Py_END_SUPPRESS_IPH
1471- if (handle == INVALID_HANDLE_VALUE ) {
1472- PyErr_SetFromErrno (PyExc_OSError );
1462+ handle = (HANDLE )_Py_get_osfhandle (fd );
1463+ if (handle == INVALID_HANDLE_VALUE )
14731464 return -1 ;
1474- }
14751465
14761466 /* get the file type, ignore the error if it failed */
14771467 ftype = GetFileType (handle );
0 commit comments