diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2012-03-13 20:59:15 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2012-03-13 20:59:15 (GMT) |
commit | df50cebbed06731512543de7fb96137ecb453ab2 (patch) | |
tree | 7e3864b6f32d94dab3e66c9a875b391e19f4128a /Modules | |
parent | 5c3c4242375998c1118f9724340a91ef28dd5368 (diff) | |
download | cpython-df50cebbed06731512543de7fb96137ecb453ab2.zip cpython-df50cebbed06731512543de7fb96137ecb453ab2.tar.gz cpython-df50cebbed06731512543de7fb96137ecb453ab2.tar.bz2 |
Issue #3835: Refuse to use unthreaded Tcl in threaded Python.
Patch by Guilherme Polo and Andrew Svetlov.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/_tkinter.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c index abbe0ec..94ae48d 100644 --- a/Modules/_tkinter.c +++ b/Modules/_tkinter.c @@ -613,6 +613,13 @@ Tkapp_New(char *screenName, char *className, } #endif #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 Tcl is threaded, we don't need the lock. */ PyThread_free_lock(tcl_lock); |