Message2675

Author pjenvey
Recipients
Date 2007-03-03.03:06:25
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Attempting to pass a None globals object to __import__ raises an error.

This is commonly done when you only want to specify one of the last arguments (like fromlist), and don't bother specifying globals (or locals), e.g.:

__import__('mypackage.mymodule', None, None, ['mymodule'])

Tests are also attached. Without the fix, the following is raised by the new test:

======================================================================
ERROR: testImpWrapperNoContext (__main__.ImportHooksTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/beans/home/pjenvey/src/java/jython-2.3/dist/Lib/unittest.py", line 229, in __call__
  File "test_importhooks.py", line 208, in testImpWrapperNoContext
  File "test_importhooks.py", line 201, in doTestImpWrapper
AttributeError: __getitem__
History
Date User Action Args
2008-02-20 17:18:40adminlinkissue1672800 messages
2008-02-20 17:18:40admincreate