Message5762

Author sven
Recipients sven
Date 2010-05-06.15:35:37
SpamBayes Score 2.7799985e-13
Marked as misclassified No
Message-id <1273160139.62.0.500447625084.issue1607@psf.upfronthosting.co.za>
In-reply-to
Content
In Jython the __import__ function works differently than the one in CPython, CPython allows an empty string as globals while Jython doesn't.

__import__('csv','') works in CPython while it doesn't work in Jython

svekle@blackdevil:~> jython             
Jython 2.5.1+ (unknown:exported, May 6 2010, 12:31:38) 
[Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.6.0_15
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('csv','')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: str indices must be integers

svekle@blackdevil:~> python2.5
Python 2.5.4 (r254:67916, Jan 20 2010, 21:44:03) 
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> __import__('csv','')
<module 'csv' from '/usr/lib/python2.5/csv.pyc'>
History
Date User Action Args
2010-05-06 15:35:40svensetrecipients: + sven
2010-05-06 15:35:39svensetmessageid: <1273160139.62.0.500447625084.issue1607@psf.upfronthosting.co.za>
2010-05-06 15:35:39svenlinkissue1607 messages
2010-05-06 15:35:37svencreate