From: Jochen V. <vo...@se...> - 2004-11-11 09:56:35
|
Hello, currently the GTK backends for matplotlib won't build without an X-server connection. The following patch fixes this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- setup.py 4 Nov 2004 15:58:57 -0000 1.108 +++ setup.py 11 Nov 2004 09:54:24 -0000 @@ -122,11 +122,16 @@ build_transforms(ext_modules, packages, NUMERIX) =20 if BUILD_GTKAGG: - try: import gtk - except ImportError: print 'GTKAgg requires pygtk' - else: - BUILD_AGG =3D 1 - build_gtkagg(ext_modules, packages) + try: + import gtk + except ImportError: + print 'GTKAgg requires pygtk' + BUILD_GTKAGG=3D0 + except RuntimeError: + print 'pygtk present but import failed' +if BUILD_GTKAGG: + BUILD_AGG =3D 1 + build_gtkagg(ext_modules, packages) =20 if BUILD_TKAGG: try: import Tkinter =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D It makes use of the fact the the import of gtk fails with an RuntimeError instead of an ImportError when the module is present but not X-server is there. Do you think that this is safe to commit? Or will it have unwanted side-effects? I hope this helps, Jochen --=20 http://seehuhn.de/ |