[PyQt] Eric3 issue: importing modules with the same name as an Eric module

Detlev Offenbach detlev at die-offenbachs.de
Fri Nov 9 17:42:09 GMT 2007


On Donnerstag, 8. November 2007, Sundance wrote:
> On Fri, Nov 02, 2007 at 11:57:15AM +0100, Detlev Offenbach wrote:
> > meanwhile I removed the carantined import completely because it caused
> > the interactive Python shell to not work at all. Everything entered in
> > interactive mode i.e. while not debugging ended in nirwana. Maybe you can
> > introduce your quarantined import into eric4 (latest snapshot), test it
> > extensively and send the patches back.
>
> Okay, no worries -- the whole idea introduced WAY too much black magic
> anyway, so I'm not all that surprised it'd misbehave on some versions of
> Python. Ah well, it was a fun project to work on anyway. :)
>
> However, the initial issue -- that you can't debug a project that has a
> Config module -- still remains. Then again, I think it could probably be
> fixed in a much simpler way, by using absolute imports instead of
> relative imports.
>
> For instance, on my computer, this module is installed as:
>
>   /usr/share/eric/modules/DebugClients/Python/Config.py
>
> ... and imported in DebugClientBase as:
>
>   from Config import ConfigVarTypeStrings
>
> So we could simply fix the issue by replacing the above line with:
>
>   from DebugClients.Python.Config import ConfigVarTypeStrings
>
> This fixes the issue on my computer.
>
> In fact, this change should probably be applied to all the modules that
> the DebugClient currently imports as relative imports.
>
> What do you think?
>
> Thanks again for your patience with this issue!
>

As stated in an earlier post, this kind of import fails over here. It seems, 
there is no general solution to this problem.

Detlev
-- 
Detlev Offenbach
detlev at die-offenbachs.de


More information about the PyQt mailing list