[Patches] [ python-Patches-701743 ] Reloading pseudo modules

SourceForge.net noreply@sourceforge.net
Sat, 15 Mar 2003 05:51:44 -0800


Patches item #701743, was opened at 2003-03-11 19:59
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=701743&group_id=5470

Category: Core (C code)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Reloading pseudo modules

Initial Comment:
Python allows to put something that is not a module in
sys.modules. Unfortunately reload() does not work wth
such a pseudo module ("TypeError: reload() argument
must be module" is raised). This patch changes
Python/import.c::PyImport_ReloadModule() so that it
works with anything that has a __name__ attribute that
can be found in sys.modules.keys().

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-03-15 14:51

Message:
Logged In: YES 
user_id=21627

I think the exceptions need to be reworked: "must be a
module" now only occurs if m is NULL. Under what
circumstances could that happen? Failure to provide __name__
is passed through; shouldn't this get diagnosed in a better way?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=701743&group_id=5470