[IronPython] Double-Import Bug

Travis Watkins alleykat at gmail.com
Wed May 18 04:24:08 CEST 2005


On 5/17/05, Curt Hagenlocher <curt at hagenlocher.org> wrote:
> > Is this bug known?
> > That is, if a module fails to import, a second attempt to import does
> > not throw an exception. I think this is because
> > Importer.LoadFromSource puts the module into sys.modules before
> > calling the import function, but does not remove it if the import
> > function fails.
> 
> I believe that this behavior is consistent with that of CPython.
> 
> --
> Curt Hagenlocher
> curt at hagenlocher.org

>From CPython:
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "foo.py", line 1, in ?
    import bar
ImportError: No module named bar
>>> import foo
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "foo.py", line 1, in ?
    import bar
ImportError: No module named bar
>>>

-- 
Travis Watkins
http://www.realistanew.com



More information about the Ironpython-users mailing list