--- From Python/import.c : ---
object *
reload_module(m)
object *m;
{
char *name;
if (m == NULL || !is_moduleobject(m)) {
err_setstr(TypeError, "reload() argument must be module");
return NULL;
}
name = getmodulename(m);
if (name == NULL)
return NULL;
/* XXX Ought to check for builtin modules -- can't reload these... */
return get_module(m, name, (object **)NULL);
}
--- and somewhere in function get_module(): ---
if (fp == NULL) {
sprintf(namebuf, "No module named %s", name);
err_setstr(ImportError, namebuf);
return NULL;
}
If it's documented in the source, does that make it a *feature* rather
than a *bug* ?
[ Tommy: What exactly caused the core dump you described to me the
other day? I tried what I thought you said, and on AIX Python, it
didn't crash. But, it also didn't do what you wanted - i.e. clear
and reinitialize sys. ( Also, I'm still not quite sure why you
want/need to do this. What specifically needs to be reset ? ) ]
- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics