summaryrefslogtreecommitdiff
path: root/Modules/_tkinter.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/_tkinter.c')
-rw-r--r--Modules/_tkinter.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/_tkinter.c b/Modules/_tkinter.c
index abbe0ec7bb..94ae48d388 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);