rpms/python-nltk/F-13 nltk-0.9.9-avoid-gtk-runtime-error.patch, NONE, 1.1 python-nltk.spec, 1.13, 1.14

Robin 'cheese' Lee cheeselee at fedoraproject.org
Tue May 18 16:43:41 UTC 2010


Author: cheeselee

Update of /cvs/pkgs/rpms/python-nltk/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv14130

Modified Files:
	python-nltk.spec 
Added Files:
	nltk-0.9.9-avoid-gtk-runtime-error.patch 
Log Message:
* Wed May 19 2010 Robin Lee <robinlee.sysu at gmail.com> - 1:0.9.9-2
- Added a patch provided by Will Woods to avoid a RuntimeError when importing
  gtk


nltk-0.9.9-avoid-gtk-runtime-error.patch:
 __init__.py |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

--- NEW FILE nltk-0.9.9-avoid-gtk-runtime-error.patch ---
diff -up nltk-0.9.9/nltk/__init__.py.avoid-gtk-runtime-error nltk-0.9.9/nltk/__init__.py
--- nltk-0.9.9/nltk/__init__.py.avoid-gtk-runtime-error	2009-10-04 20:10:12.000000000 -0400
+++ nltk-0.9.9/nltk/__init__.py	2009-10-04 20:13:20.000000000 -0400
@@ -136,8 +136,13 @@ except ImportError:
     warnings.warn("draw module, app module, and gui downloader not loaded "
                   "(please install Tkinter library).")
 else:
-    import app, draw
-    from downloader import download_gui
+    try:
+        import app, draw
+        from downloader import download_gui
+    except RuntimeError, e:
+        import warnings
+        warnings.warn("draw module, app module, and gui downloader not loaded "
+                      "(RuntimeError during import: %s" % str(e))
 
 # override any accidentally imported demo
 def demo():


Index: python-nltk.spec
===================================================================
RCS file: /cvs/pkgs/rpms/python-nltk/F-13/python-nltk.spec,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -p -r1.13 -r1.14
--- python-nltk.spec	17 May 2010 13:18:29 -0000	1.13
+++ python-nltk.spec	18 May 2010 16:43:41 -0000	1.14
@@ -6,7 +6,7 @@
 Name:           python-nltk
 Epoch:          1
 Version:        0.9.9
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Natural Language Toolkit
 
 Group:          Development/Libraries
@@ -14,6 +14,7 @@ License:        GPLv2
 URL:            http://www.nltk.org/
 Source0:        http://nltk.googlecode.com/files/nltk-%{version}%{?prerel}.tar.gz
 Patch0:         nltk-0.9.9-use-sys-yaml.patch
+Patch1:         nltk-0.9.9-avoid-gtk-runtime-error.patch
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 BuildArch:      noarch
 
@@ -32,6 +33,7 @@ research projects.
 %prep
 %setup -q -n nltk-%{version}%{?prerel}
 %patch0 -p1 -b .use-sys-yaml
+%patch1 -p1 -b .avoid-gtk-runtime-error
 
 
 %build
@@ -74,6 +76,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Wed May 19 2010 Robin Lee <robinlee.sysu at gmail.com> - 1:0.9.9-2
+- Added a patch provided by Will Woods to avoid a RuntimeError when importing
+  gtk
+
 * Mon May 17 2010 Robin Lee <robinlee.sysu at gmail.com> - 1:0.9.9-1
 - Update to 0.9.9 (#527148,#545521)
 - Remove specifications for obsolete Fedora versions



More information about the scm-commits mailing list