Message3633
If there is nested contextmanager and try clause does not work as expected
with another_contextmanager():
try:
with some_error_rasing_contextmanager():
pass
except:
print 'catch'
----
enex:src ruseel$ python --version
Python 2.5.1
enex:src ruseel$ python test_contextmanager.py
catch
.
----------------------------------------------------------------------
Ran 1 test in 0.000s
OK
enex:src ruseel$ jython --version
Jython 2.5a3 (trunk:5315:5317, Sep 10 2008, 20:54:23)
[Java HotSpot(TM) Client VM (Apple Inc.)] on java1.5.0_13
enex:src ruseel$ jython test_contextmanager.py
E
======================================================================
ERROR: test_a (__main__.TestContextManager)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_contextmanager.py", line 0, in test_a
File "/Users/ruseel/jython2.5a3/Lib/contextlib.py", line 81, in helper
return GeneratorContextManager(func(*args, **kwds))
File "test_contextmanager.py", line 7, in some_cm
raise ValueError('error from some_cm()')
ValueError: error from some_cm()
----------------------------------------------------------------------
Ran 1 test in 0.019s
FAILED (errors=1) |
|
Date |
User |
Action |
Args |
2008-10-02 04:18:42 | ruseel | set | recipients:
+ ruseel |
2008-10-02 04:18:42 | ruseel | set | messageid: <1222921122.45.0.694551434159.issue1142@psf.upfronthosting.co.za> |
2008-10-02 04:18:42 | ruseel | link | issue1142 messages |
2008-10-02 04:18:41 | ruseel | create | |
|