Message842

Author pedronis
Recipients
Date 2003-05-15.00:36:24
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
consider

>>> from java.io import IOException as IOExc
>>> try:
...   raise IOExc
... except IOError,e:
...   try:
...    raise e
...   except IOExc,f:
...    print "IOExc as IOExc"
...    assert isinstance(f,IOExc)
...   assert isinstance(e,IOError),"broken spell"
...
IOExc as IOExc
Traceback (innermost last):
  File "<console>", line 9, in ?
AssertionError: broken spell
>>> try:
...  from java.lang import OutOfMemoryError as Boom
...  raise Boom
... except MemoryError,e:
...  assert isinstance(e,MemoryError),"broken spell"
...
Traceback (innermost last):
  File "<console>", line 5, in ?
AssertionError: broken spell

the asserts should hold

[f is e is not so relevant]
History
Date User Action Args
2008-02-20 17:17:15adminlinkissue737978 messages
2008-02-20 17:17:15admincreate