gh-118422: Fix run_fileexflags() test (#118429)

Don't test the undefined behavior of fileno()
on a closed file, but use fstat() as a reliable
test if the file was closed or not.
This commit is contained in:
Victor Stinner 2024-04-30 22:32:55 +02:00 committed by GitHub
parent 587388ff22
commit e93c39b47e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 62 additions and 58 deletions

View file

@ -326,6 +326,9 @@ extern int _PyFile_Flush(PyObject *);
extern int _Py_GetTicksPerSecond(long *ticks_per_second);
#endif
// Export for '_testcapi' shared extension
PyAPI_FUNC(int) _Py_IsValidFD(int fd);
#ifdef __cplusplus
}
#endif