mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
Patch by Guilherme Polo and Andrew Svetlov.
This commit is contained in:
parent
5c3c424237
commit
df50cebbed
2 changed files with 9 additions and 0 deletions
|
|
@ -24,6 +24,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
|
||||||
|
|
||||||
- Issue #2843: Add new Tk API to Tkinter.
|
- Issue #2843: Add new Tk API to Tkinter.
|
||||||
|
|
||||||
- Issue #14184: Increase the default stack size for secondary threads on
|
- Issue #14184: Increase the default stack size for secondary threads on
|
||||||
|
|
|
||||||
|
|
@ -613,6 +613,13 @@ Tkapp_New(char *screenName, char *className,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef WITH_THREAD
|
#ifdef WITH_THREAD
|
||||||
|
if (!(v->threaded)) {
|
||||||
|
PyErr_SetString(PyExc_RuntimeError,
|
||||||
|
"Tcl/Tk was not compiled with --enable-threads but "
|
||||||
|
"Python has threads enabled");
|
||||||
|
Py_DECREF(v);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
if (v->threaded && tcl_lock) {
|
if (v->threaded && tcl_lock) {
|
||||||
/* If Tcl is threaded, we don't need the lock. */
|
/* If Tcl is threaded, we don't need the lock. */
|
||||||
PyThread_free_lock(tcl_lock);
|
PyThread_free_lock(tcl_lock);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue