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.
2 parents 3e89069 + b4cc9cc commit 10f1522Copy full SHA for 10f1522
1 file changed
src/_tkagg.cpp
@@ -410,10 +410,19 @@ int load_tkinter_funcs(void)
410
// Load tkinter global funcs from tkinter compiled module.
411
// Return 0 for success, non-zero for failure.
412
int ret = -1;
413
- void *tkinter_lib;
+ void *main_program, *tkinter_lib;
414
char *tkinter_libname;
415
PyObject *pModule = NULL, *pSubmodule = NULL, *pString = NULL;
416
417
+ // Try loading from the main program namespace first
418
+ main_program = dlopen(NULL, RTLD_LAZY);
419
+ if (_func_loader(main_program) == 0) {
420
+ return 0;
421
+ }
422
+ // Clear exception triggered when we didn't find symbols above.
423
+ PyErr_Clear();
424
+
425
+ // Now try finding the tkinter compiled module
426
pModule = PyImport_ImportModule(TKINTER_PKG);
427
if (pModule == NULL) {
428
goto exit;
0 commit comments