Message1176

Author cgroves
Recipients
Date 2006-07-12.17:48:35
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
If I have a module that throws an exception on import,
the first time I try to import it I get an ImportError.
 The second time I try to import it, the import succeeds.

milo:~/dev/jython groves$ jytip
Jython 2.2a1 on java1.5.0_06 (JIT: null)
Type "copyright", "credits" or "license" for more
information.
>>> try:
...   import badmodule
... except:
...   pass
... 
>>> import badmodule
>>> print badmodule
<module 'badmodule' from
'/Users/groves/dev/jython/badmodule.py'>

milo:~/dev/jython groves$ python
Python 2.4.3 (#1, Apr  7 2006, 10:54:33) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for
more information.
>>> try:
...   import badmodule
... except:
...   pass
...    
>>> import badmodule
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/Users/groves/dev/jython/badmodule.py", line 1,
in ?
    import nonexistentmodule
ImportError: No module named nonexistentmodule
History
Date User Action Args
2008-02-20 17:17:31adminlinkissue1521362 messages
2008-02-20 17:17:31admincreate