Package: python3.11 / 3.11.2-6+deb12u6

tkinter-import.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Description: Suggest installation of python3-tk package
 We split Tk out into a separate binary package. Help users who try to import
 it, without it installed.

Forwarded: not-needed

--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -35,7 +35,10 @@
 import sys
 import types
 
-import _tkinter # If this fails your Python may not be configured for Tk
+try:
+    import _tkinter
+except ImportError as msg:
+    raise ImportError(str(msg) + ', please install the python3-tk package')
 TclError = _tkinter.TclError
 from tkinter.constants import *
 import re