[pygtk] ltihooks problem
Johan Dahlin
jdahlin at async.com.br
Sun Jul 15 01:15:26 WST 2007
Brad Schick wrote:
> I'm new to both python and gtk+, so hopefully I'm not missing something
> obvious.
>
> I'm writing a graphic extension to mercurial [1] using pygtk 2.10.4
> under winxp and python 2.5.1. When I start my extension directly from
> the command-line it all works fine. But when I build and install
> mercurial with my new extension, I get this error when mercurial loads
> it:
>
> "No module named ltihooks"
>
> The problem is in site-packages\gtk-2.0\gtk\__init__.py. The
> "ltihooks" statement at the top that attempts to trigger an exception
> after importing ltihooks never actually generates an exception, so the
> ltihooks name is never set to None. That causes an ImportError
> exception later when ltihooks.uninstall() is called.
>
> Two potential solutions: 1) Wrap the call to ltihooks.uinstall() with
> try/except. 2) After the import, make a call that triggers the
> exception since the plain "ltihooks" statement does not seem to be
> enough.
First one seems like a good solution.
I committed it to PyGTK trunk.
> I tried solution #1 and it worked, but I don't fully grok the
> situation. For example, why doesn't the gtk\__init__.py run when I
> start my extension directly from the command-line? Also why can't
> ltihooks be located... I see it in the pygtk sources?
It's not installed, it's only used in 'uninstalled' mode, eg when running
pygtk from the source directory without installing it to a prefix such as
/usr/local. It's only useful on systems which uses libtool, I guess it's not
particularly relevant on Windows systems.
--
Johan Dahlin <jdahlin at async.com.br>
Async Open Source
More information about the pygtk
mailing list