Message329

Author mlh
Recipients
Date 2001-07-02.01:37:53
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Ran the following code in both CPython and Jython (through 'import anygui'):

-- anygui.py --

impl_names = ['java']

# Will only return anygui :P
impls = [__import__('anygui.impl.%sgui' % name,
                    fromlist=['%sgui' % name]) for name in impl_names]

#viable_impls = [impl for impl in impls if impl.viable]

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

And got the following two (different) error messages:

CPython 2.1:
>>> import anygui
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/home/idi/f/mlh/python/anygui/__init__.py", line 5, in ?
    fromlist=['%sgui' % name]) for name in impl_names]
TypeError: __import__() takes no keyword arguments
>>>

Jython 2.1a1:
>>> import anygui
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "S:\python\anygui\__init__.py", line 5, in ?
TypeError: sequence subscript must be integer or slice

The CPython error message is a bit more understandable than the Jython message, IMO...
History
Date User Action Args
2008-02-20 17:16:51adminlinkissue437800 messages
2008-02-20 17:16:51admincreate