Patches item #1290454, was opened at 2005-09-13 16:57
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1290454&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Collin Winter (collinwinter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix reload() error message

Initial Comment:
As of CVS revision 2.242, PyImport_ReloadModule gives
the wrong error message when the parent module no
longer exists in sys.modules. Below is a sample session:

Python 2.4.1 (#1, Aug 11 2005, 08:51:39)
[GCC 3.3.5 (Debian 1:3.3.5-12)] on linux2
Type "help", "copyright", "credits" or "license" for
more information.
>>> import distutils.command.sdist 
>>> import sys
>>> del sys.modules['distutils.command']
>>> del sys.modules['distutils']
>>> reload(distutils.command.sdist)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: reload(): parent distutils.command.sdist
not in sys.modules
>>>

The ImportError message should read "reload(): parent
distutils.command not in sys.modules". The attached
patch (against import.c, r2.242) fixes this behaviour.
The patch has been tested with the regression suite
shipped with Python 2.4.1.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1290454&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches

Reply via email to