@@ -322,13 +322,10 @@ int load_tkinter_funcs(void)
322322#else // not Windows
323323
324324/*
325- * On Unix, we can get the TCL and Tk synbols from the tkinter module, because
325+ * On Unix, we can get the TCL and Tk symbols from the tkinter module, because
326326 * tkinter uses these symbols, and the symbols are therefore visible in the
327327 * tkinter dynamic library (module).
328328 */
329- #if PY_MAJOR_VERSION >= 3
330- #define TKINTER_PKG " tkinter"
331- #define TKINTER_MOD " _tkinter"
332329// From module __file__ attribute to char *string for dlopen.
333330char *fname2char (PyObject *fname)
334331{
@@ -339,12 +336,6 @@ char *fname2char(PyObject *fname)
339336 }
340337 return PyBytes_AsString (bytes);
341338}
342- #else
343- #define TKINTER_PKG " Tkinter"
344- #define TKINTER_MOD " tkinter"
345- // From module __file__ attribute to char *string for dlopen
346- #define fname2char (s ) (PyString_AsString(s))
347- #endif
348339
349340#include < dlfcn.h>
350341
@@ -402,11 +393,11 @@ int load_tkinter_funcs(void)
402393 PyErr_Clear ();
403394
404395 // Now try finding the tkinter compiled module
405- pModule = PyImport_ImportModule (TKINTER_PKG );
396+ pModule = PyImport_ImportModule (" tkinter " );
406397 if (pModule == NULL ) {
407398 goto exit;
408399 }
409- pSubmodule = PyObject_GetAttrString (pModule, TKINTER_MOD );
400+ pSubmodule = PyObject_GetAttrString (pModule, " _tkinter " );
410401 if (pSubmodule == NULL ) {
411402 goto exit;
412403 }
@@ -453,7 +444,6 @@ int load_tkinter_funcs(void)
453444}
454445#endif // end not Windows
455446
456- #if PY_MAJOR_VERSION >= 3
457447static PyModuleDef _tkagg_module = { PyModuleDef_HEAD_INIT, " _tkagg" , " " , -1 , functions,
458448 NULL , NULL , NULL , NULL };
459449
@@ -465,11 +455,3 @@ PyMODINIT_FUNC PyInit__tkagg(void)
465455
466456 return (load_tkinter_funcs () == 0 ) ? m : NULL ;
467457}
468- #else
469- PyMODINIT_FUNC init_tkagg (void )
470- {
471- Py_InitModule (" _tkagg" , functions);
472-
473- load_tkinter_funcs ();
474- }
475- #endif
0 commit comments