mirror of
https://github.com/python/cpython.git
synced 2025-09-03 15:31:08 +00:00

In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
22 lines
715 B
C
Generated
22 lines
715 B
C
Generated
/*[clinic input]
|
|
preserve
|
|
[clinic start generated code]*/
|
|
|
|
PyDoc_STRVAR(_thread__is_main_interpreter__doc__,
|
|
"_is_main_interpreter($module, /)\n"
|
|
"--\n"
|
|
"\n"
|
|
"Return True if the current interpreter is the main Python interpreter.");
|
|
|
|
#define _THREAD__IS_MAIN_INTERPRETER_METHODDEF \
|
|
{"_is_main_interpreter", (PyCFunction)_thread__is_main_interpreter, METH_NOARGS, _thread__is_main_interpreter__doc__},
|
|
|
|
static PyObject *
|
|
_thread__is_main_interpreter_impl(PyObject *module);
|
|
|
|
static PyObject *
|
|
_thread__is_main_interpreter(PyObject *module, PyObject *Py_UNUSED(ignored))
|
|
{
|
|
return _thread__is_main_interpreter_impl(module);
|
|
}
|
|
/*[clinic end generated code: output=505840d1b9101789 input=a9049054013a1b77]*/
|