[weboob] [PATCH 1/2] setup.py: print what executable we were looking for

Adrien Kunysz adrien at kunysz.be
Sun Nov 4 15:04:56 CET 2012

The error message is sometimes confusing. Consider the following
situation on Debian 6.0:

$ python setup.py
Building Qt applications
Install PyQt4-devel or disable Qt applications (with --no-qt).
$ dpkg -l | grep -i python | grep -i qt
ii  python-qt4          4.7.3-1+b1         Python bindings for Qt4
ii  python-qt4-dev      4.7.3-1            Development files for PyQt4

What is really missing is the pyuic4 executable which is provided by
a different package on that distribution. But you have no way to know
that unless you go look into setup.py. This change prints what
executable we are missing as to help diagnose this kind of problem:

$ python setup.py
Building Qt applications
Could not find executable: pyuic4
Install PyQt4-devel or disable Qt applications (with --no-qt).

Notice that until e69adf357b15569157c44c4581f27890674f82ff,
the name of the missing executable was printed as well.

Signed-off-by: Adrien Kunysz <adrien at kunysz.be>
 setup.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/setup.py b/setup.py
index 346c349..40a3196 100755
--- a/setup.py
+++ b/setup.py
@@ -41,6 +41,7 @@ def find_executable(name, names):
                 fpath = os.path.join(path, name) + ext
                 if os.path.exists(fpath) and os.access(fpath, os.X_OK):
                     return fpath
+    print >>sys.stderr, 'Could not find executable: %s' % name
 def build_qt():

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <https://lists.symlink.me/pipermail/weboob/attachments/20121104/8cccc93b/attachment.sig>

More information about the weboob mailing list