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
|