Unloading a dll

Steve Holden sholden at holdenweb.com
Tue Dec 17 23:51:46 EST 2002


"Jive Dadson" <dsdfdsadfas at isdfssdfasdf.invalid> wrote ..
> Grzegorz Dostatni wrote:
> >
> > I am not sure whether this will work for compiled dlls (I think it
> > should), but you could try reload.
> >
> > Help on built-in function reload:
> >
> > reload(...)
> >     reload(module) -> module
> >
> >     Reload the module.  The module must have been successfully imported
> > before.
> >
> > Greg
>
> I would have to hack the program that loads the dll to do that, right?
>

Unlike Python modules, I don't believe it's possible to reload Python
extensions (i.e. compiled files such as DLLs) once they have been loaded.
The 2.2 docs say """It is legal though generally not very useful to reload
built-in or dynamically loaded modules, except for sys, __main__ and
__builtin__. In many cases, however, extension modules are not designed to
be initialized more than once, and may fail in arbitrary ways when reloaded.
"""

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Bring your musical instrument to PyCon!    http://www.python.org/pycon/
-----------------------------------------------------------------------






More information about the Python-list mailing list