The imp module and cyclic imports

2005-11-24 Thread Matthias Kramm
Hi All, I'm having a little bit of trouble using the "imp" module to dynamically import modules. It seems that somehow cyclic references of modules don't work. I'm unable to get the following to work: I've got the following files: web/__init__.py web/one.py web/two.py testimport.py >From which

Re: The imp module and cyclic imports

2005-11-24 Thread Fredrik Lundh
Matthias Kramm wrote: > I'm having a little bit of trouble using the "imp" module to > dynamically import modules. It seems that somehow cyclic > references of modules don't work. the problem you're seeing appears also if you use "import web.one" or "from web import one" or "__import__('web.one')

Re: The imp module and cyclic imports

2005-11-27 Thread Matthias Kramm
b1/one.py web2/two.py there doesn't seem to be any way to make one.py and two.py reference each other via (non-delayed) imports. It's interesting, though, that cyclic imports work when using the plain "import foo" import, but not with the "from package import foo" sty