File: tkinter-import

package info (click to toggle)
pypy3 7.3.11%2Bdfsg-2%2Bdeb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 201,024 kB
  • sloc: python: 1,950,308; ansic: 517,580; sh: 21,417; asm: 14,419; cpp: 4,263; makefile: 4,228; objc: 761; xml: 530; exp: 499; javascript: 314; pascal: 244; lisp: 45; csh: 11; awk: 4
file content (29 lines) | stat: -rw-r--r-- 999 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
From: Stefano Rivera <stefanor@debian.org>
Date: Sat, 7 Oct 2017 09:38:58 +0200
Subject: Debian: Suggest installation of pypy3-tk package

On failing _tkinter import.

Author: Matthias Klose <doko@debian.org>
Author: Stefano Rivera <stefanor@debian.org>
Last-Update: 2013-11-15
---
 lib-python/3/tkinter/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib-python/3/tkinter/__init__.py b/lib-python/3/tkinter/__init__.py
index 817d6b0..7d9561b 100644
--- a/lib-python/3/tkinter/__init__.py
+++ b/lib-python/3/tkinter/__init__.py
@@ -39,7 +39,10 @@ except ModuleNotFoundError:
     def add_memory_pressure(*args):
         pass
 
-import _tkinter # If this fails your Python may not be configured for Tk
+try:
+    import _tkinter # If this fails your Python may not be configured for Tk
+except ImportError as msg:
+    raise ImportError(str(msg) + ', please install the pypy3-tk package')
 TclError = _tkinter.TclError
 from tkinter.constants import *
 import re