~ubuntu-branches/ubuntu/raring/python3.3/raring-proposed

« back to all changes in this revision

Viewing changes to debian/patches/tkinter-import.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-03-22 06:14:01 UTC
  • Revision ID: package-import@ubuntu.com-20120322061401-vvrgvw3nvi68rtqq
Tags: 3.3.0~a1-1
* Python 3.3.0 alpha1 release.
* Update to 20120321 from the trunk.
* Update debian/copyright.
* Build-depend on expat (>= 2.1~).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# DP: suggest installation of python-tk package on failing _tkinter import
 
2
 
 
3
Index: b/Lib/tkinter/__init__.py
 
4
===================================================================
 
5
--- a/Lib/tkinter/__init__.py
 
6
+++ b/Lib/tkinter/__init__.py
 
7
@@ -37,7 +37,10 @@
 
8
 
 
9
 import warnings
 
10
 
 
11
-import _tkinter # If this fails your Python may not be configured for Tk
 
12
+try:
 
13
+    import _tkinter
 
14
+except ImportError as msg:
 
15
+    raise ImportError(str(msg) + ', please install the python-tk package')
 
16
 TclError = _tkinter.TclError
 
17
 from tkinter.constants import *
 
18