#69: importHook and relative import in __init__ files
-------------------------+--------------------------------------------------
Reporter: openticket | Owner: giovannibajo
Type: defect | Status: new
Priority: normal | Milestone: PyInstaller 1.4
Component: PyInstaller | Version: PyInstaller 1.4
Severity: major | Keywords:
-------------------------+--------------------------------------------------
In my packages, I decided to go "politically correct" with imports and to
do all my internal imports as relative imports. However, there's a
conflict with that and pyinstaller.
For example, if I have a package "foo" and a subpackage "bar" with a unit
"baz" in it. if I do "from .baz import *" in foo/bar/__init__.py,
pyinstaller's importHook will not be able to correctly perform the import.
I tried to hack the code, but unfortunately, this thing is way too
complex. I think it has to do with im.py:403, "importernm =
_string_split(importernm, '.')[:-level]". importnm will be "foo.bar" in
this case, and this will make pyinstaller try to import "baz" from "foo"
instead of "foo.bar".
--
Ticket URL: <http://www.pyinstaller.org/ticket/69>
Pyinstaller <http://www.pyinstaller.org>
PyInstaller Project
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"PyInstaller" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/PyInstaller?hl=en
-~----------~----~----~----~------~----~------~--~---