summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_pystate.h
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2020-06-03 12:39:59 (GMT)
committerGitHub <noreply@github.com>2020-06-03 12:39:59 (GMT)
commitfa7ab6aa0f9a4f695e5525db5a113cd21fa93787 (patch)
treedb9c9a9fc6908662ed752d6617a719cc566f155f /Include/internal/pycore_pystate.h
parent18a90248fdd92b27098cc4db773686a2d10a4d24 (diff)
downloadcpython-fa7ab6aa0f9a4f695e5525db5a113cd21fa93787.zip
cpython-fa7ab6aa0f9a4f695e5525db5a113cd21fa93787.tar.gz
cpython-fa7ab6aa0f9a4f695e5525db5a113cd21fa93787.tar.bz2
bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)
my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for pending signals, rather calling PyOS_InterruptOccurred(). my_fgets() is called with the GIL released, whereas PyOS_InterruptOccurred() must be called with the GIL held. test_repl: use text=True and avoid SuppressCrashReport in test_multiline_string_parsing(). Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.
Diffstat (limited to 'Include/internal/pycore_pystate.h')
-rw-r--r--Include/internal/pycore_pystate.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Include/internal/pycore_pystate.h b/Include/internal/pycore_pystate.h
index 423c811..0cd5550 100644
--- a/Include/internal/pycore_pystate.h
+++ b/Include/internal/pycore_pystate.h
@@ -144,6 +144,9 @@ PyAPI_FUNC(int) _PyState_AddModule(
PyObject* module,
struct PyModuleDef* def);
+
+PyAPI_FUNC(int) _PyOS_InterruptOccurred(PyThreadState *tstate);
+
#ifdef __cplusplus
}
#endif