summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2024-04-30 20:32:55 (GMT)
committerGitHub <noreply@github.com>2024-04-30 20:32:55 (GMT)
commite93c39b47ea623dfaf61f80775ad4747b163efe5 (patch)
tree0747773aa2298b73ff300c94dae89974dfc8f796 /Include
parent587388ff22dc7cfa4b66722daf0d33cd804af9f2 (diff)
downloadcpython-e93c39b47ea623dfaf61f80775ad4747b163efe5.zip
cpython-e93c39b47ea623dfaf61f80775ad4747b163efe5.tar.gz
cpython-e93c39b47ea623dfaf61f80775ad4747b163efe5.tar.bz2
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.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_fileutils.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h
index bc8100b..13f86b0 100644
--- a/Include/internal/pycore_fileutils.h
+++ b/Include/internal/pycore_fileutils.h
@@ -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