Skip to content

Commit 496f8f6

Browse files
committed
Removed remaining support for Tk versions below 4.0.
1 parent 9cc8a20 commit 496f8f6

1 file changed

Lines changed: 7 additions & 28 deletions

File tree

Modules/_tkinter.c

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,14 @@ PERFORMANCE OF THIS SOFTWARE.
3535
/* TCL/TK VERSION INFO:
3636
3737
Unix:
38-
This should work with any version from Tcl 4.0 / Tck 7.4.
39-
Do not use older versions.
38+
Tcl/Tk 8.0 (even alpha or beta) or 7.6/4.2 are recommended.
39+
This should work with any version from 7.4/4.0 upwards.
40+
Tk 3.x is no longer supported.
4041
4142
Mac and Windows:
42-
Use Tcl 4.1p1 / Tk 7.5p1 or possibly newer.
43-
It does not seem to work reliably with the original 4.1/7.5
44-
release. (4.0/7.4 were never released for these platforms.)
43+
Use Tcl 8.0 if available (even alpha or beta).
44+
The oldest usable version is 4.1p1/7.5p1.
45+
4546
*/
4647

4748
#include "Python.h"
@@ -67,7 +68,7 @@ extern int tk_NumMainWindows;
6768
#endif
6869

6970
#if TK_MAJOR_VERSION < 4
70-
extern struct { Tk_Window win; } *tkMainWindowList;
71+
#error "Tk 3.x is not supported"
7172
#endif
7273

7374
#ifdef macintosh
@@ -1462,19 +1463,6 @@ EventHook ()
14621463
}
14631464
#endif /* WITH_READLINE */
14641465

1465-
static void
1466-
Tkinter_Cleanup ()
1467-
{
1468-
/* This segfault with Tk 4.0 beta and seems unnecessary there as
1469-
* well */
1470-
1471-
#if TK_MAJOR_VERSION < 4
1472-
/* XXX rl_deprep_terminal is static, damned! */
1473-
while (tkMainWindowList != 0)
1474-
Tk_DestroyWindow(tkMainWindowList->win);
1475-
#endif
1476-
}
1477-
14781466

14791467
/* all errors will be checked in one fell swoop in init_tkinter() */
14801468
static void
@@ -1506,8 +1494,6 @@ ins_string(d, name, val)
15061494
void
15071495
init_tkinter ()
15081496
{
1509-
static inited = 0;
1510-
15111497
#ifdef WITH_READLINE
15121498
extern int (*rl_event_hook) ();
15131499
#endif /* WITH_READLINE */
@@ -1538,13 +1524,6 @@ init_tkinter ()
15381524
rl_event_hook = EventHook;
15391525
#endif /* WITH_READLINE */
15401526

1541-
if (!inited) {
1542-
inited = 1;
1543-
if (Py_AtExit(Tkinter_Cleanup) != 0)
1544-
fprintf(stderr,
1545-
"Tkinter: warning: cleanup procedure not registered\n");
1546-
}
1547-
15481527
if (PyErr_Occurred())
15491528
Py_FatalError ("can't initialize module _tkinter");
15501529
#ifdef macintosh

0 commit comments

Comments
 (0)