~ubuntu-branches/ubuntu/maverick/python3.1/maverick

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-03-23 00:01:27 UTC
  • Revision ID: james.westby@ubuntu.com-20090323000127-mr2oo53y4j8vpldi
Tags: 3.1~a1+20090322-1
* Python 3.1 alpha1 release.
* Update to the trunk, 20090322.
* Update installation schemes: LP: #338395.
  - When the --prefix option is used for setup.py install, Use the
    `unix_prefix' scheme.
  - Use the `deb_system' scheme if --install-layout=deb is specified.
  - Use the the `unix_local' scheme if neither --install-layout=deb
    nor --prefix is specified.
* Use the information in /etc/lsb-release for platform.dist(). LP: #196526.
* pydoc: Fix detection of local documentation files.
* Build a shared library configured --with-pydebug. LP: #322580.
* Fix some lintian warnings.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh -e
 
2
 
 
3
# DP: suggest installation of python-tk package on failing _tkinter import
 
4
 
 
5
dir=
 
6
if [ $# -eq 3 -a "$2" = '-d' ]; then
 
7
    pdir="-d $3"
 
8
    dir="$3/"
 
9
elif [ $# -ne 1 ]; then
 
10
    echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
11
    exit 1
 
12
fi
 
13
case "$1" in
 
14
    -patch)
 
15
        patch $pdir -f --no-backup-if-mismatch -p0 < $0
 
16
        ;;
 
17
    -unpatch)
 
18
        patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
 
19
        ;;
 
20
    *)
 
21
        echo >&2 "usage: `basename $0`: -patch|-unpatch [-d <srcdir>]"
 
22
        exit 1
 
23
esac
 
24
exit 0
 
25
 
 
26
--- Lib/tkinter/__init__.py~    2008-05-30 13:47:28.000000000 +0200
 
27
+++ Lib/tkinter/__init__.py     2008-05-30 13:57:04.000000000 +0200
 
28
@@ -36,7 +36,10 @@
 
29
 if sys.platform == "win32":
 
30
     # Attempt to configure Tcl/Tk without requiring PATH
 
31
     from tkinter import _fix
 
32
-import _tkinter # If this fails your Python may not be configured for Tk
 
33
+try:
 
34
+    import _tkinter
 
35
+except ImportError as msg:
 
36
+    raise ImportError(str(msg) + ', please install the python-tk package')
 
37
 TclError = _tkinter.TclError
 
38
 from tkinter.constants import *
 
39
 try: