Patches item #1290454, was opened at 2005-09-13 22:57
Message generated for change (Comment added) made by birkenfeld
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: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Collin Winter (collinwinter)
>Assigned to: Reinhold Birkenfeld (birkenfeld)
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.

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

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-09-14 09:01

Message:
Logged In: YES 
user_id=1188172

Thanks for the fix! However, please produce a context diff
in the future, it makes it much easier to grasp, ehm, the
context of the changes, so that one does not have to apply
the patch before reviewing it.

Committed as import.c r2.243, r2.240.2.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