Message842
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] |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:15 | admin | link | issue737978 messages |
2008-02-20 17:17:15 | admin | create | |
|