straw-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Straw-devel] module_check in setup.py


From: Juri Pakaste
Subject: [Straw-devel] module_check in setup.py
Date: Mon, 19 Jan 2004 23:07:31 +0200

I filed a bug on this, but I thought I'd bring the discussion to the
list, now that I investigated this a bit more.

Now that we're using distutils (thanks Terje), we have the module_check
thingy in setup.py. I don't know if I'm the only one here installing
stuff from an shell without access to a $DISPLAY by default, but for me,
at least, $ python setup.py install doesn't work out of the box. This is
caused by import gtk causing a RuntimeError when there's no X display.

It seems that the RuntimeError can be avoided by calling
imp.find_module('gtk'), but the problem is, there are the subpackages.
And because of the way Python's module system work, you can import - or
even check for the existence of - a.b without first importing a. So no
checking for gtk.glade.

So, basically, I guess we have to sensible approaches. We have to catch
RuntimeError, I suppose; I have no idea if it's possible for it to be
something besides the X display error. I'd rather not check the string
value, who knows, it might be localized or something somewhere.

After that, we can either 

a) tell the user we got an runtimeerror, it's probably about X (and
maybe print out the error just in case), he should either run with
--disable-modules-check or with $DISPLAY

or 

b) tell the user we got an runtimeerror but keep on going.

Opinions?

-- 
[ Juri Pakaste / address@hidden / http://www.iki.fi/juri/ ]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]