> That's OK, but you may find fiddling with sys.path is more productive :-)
Yeah, that's what I'm doing and it works just fine. When I stumbled
over this behavior yesterday it seemed (and still does) like a
low-priority bug in reload. I was hoping a guru would reply with
something like, "Of cour
It's not just load_module. Reload fails on modules imported normally
if their paths are no longer in sys.path.
Easy to reproduce example:
bash$ mkdir module_dir
bash$ touch module_dir/plugin.py
bash$ python
Python 2.4.1 (#1, Sep 25 2005, 15:12:45)
[GCC 3.4.3 20041125 (Gentoo 3.4.3-r1, ssp-3.4.3-
Lonnie Princehouse wrote:
> Maybe it could fall back to module.__file__ if the module isn't found
> in sys.path??
> ... or reload could just take an optional path parameter...
>
> Or perhaps I'm the only one who thinks this is silly:
>
> >>> my_module = imp.load_module(module_name,
> >>> *imp.fin
Lonnie Princehouse wrote:
> So, it turns out that reload() fails if the module being reloaded isn't
> in sys.path.
>
> Maybe it could fall back to module.__file__ if the module isn't found
> in sys.path??
> ... or reload could just take an optional path parameter...
>
> Or perhaps I'm the only on
So, it turns out that reload() fails if the module being reloaded isn't
in sys.path.
Maybe it could fall back to module.__file__ if the module isn't found
in sys.path??
... or reload could just take an optional path parameter...
Or perhaps I'm the only one who thinks this is silly:
>>> my_module