Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a3d7af4 commit 033c3f2Copy full SHA for 033c3f2
1 file changed
src/_tkagg.cpp
@@ -408,10 +408,19 @@ int load_tkinter_funcs(void)
408
// Load tkinter global funcs from tkinter compiled module.
409
// Return 0 for success, non-zero for failure.
410
int ret = -1;
411
- void *tkinter_lib;
+ void *main_program, *tkinter_lib;
412
char *tkinter_libname;
413
PyObject *pModule = NULL, *pSubmodule = NULL, *pString = NULL;
414
415
+ // Try loading from the main program namespace first
416
+ main_program = dlopen(NULL, RTLD_LAZY);
417
+ if (_func_loader(main_program) == 0) {
418
+ return 0;
419
+ }
420
+ // Clear exception triggered when we didn't find symbols above.
421
+ PyErr_Clear();
422
+
423
+ // Now try finding the tkinter compiled module
424
pModule = PyImport_ImportModule(TKINTER_PKG);
425
if (pModule == NULL) {
426
goto exit;
0 commit comments