[pypy-commit] pypy default: "import _tkinter" now raises ImportError when tk.h and other development files are not installed.
amauryfa
noreply at buildbot.pypy.org
Sun Jun 16 18:29:02 CEST 2013
Author: Amaury Forgeot d'Arc <amauryfa at gmail.com>
Branch:
Changeset: r64895:b5cea7cd6c02
Date: 2013-06-16 18:28 +0200
http://bitbucket.org/pypy/pypy/changeset/b5cea7cd6c02/
Log: "import _tkinter" now raises ImportError when tk.h and other
development files are not installed.
diff --git a/lib_pypy/_tkinter/__init__.py b/lib_pypy/_tkinter/__init__.py
--- a/lib_pypy/_tkinter/__init__.py
+++ b/lib_pypy/_tkinter/__init__.py
@@ -1,5 +1,3 @@
-raise ImportError("please fix the buildbot tests, at least by raising ImportError if tcl.h/tk.h are not there")
-
# _tkinter package -- low-level interface to libtk and libtcl.
#
# This is an internal module, applications should "import Tkinter" instead.
@@ -10,7 +8,12 @@
class TclError(Exception):
pass
-from .tklib import tklib, tkffi
+import cffi
+try:
+ from .tklib import tklib, tkffi
+except cffi.VerificationError:
+ raise ImportError("Tk headers and development libraries are required")
+
from .app import TkApp
TK_VERSION = tkffi.string(tklib.get_tk_version())
More information about the pypy-commit
mailing list