You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Merge branch 'python-3.3-to-3.5' into python-3.0-to-3.2
This commit is contained in:
BIN
test/bytecode_3.6_run/08_test_contextmanager.pyc
Normal file
BIN
test/bytecode_3.6_run/08_test_contextmanager.pyc
Normal file
Binary file not shown.
BIN
test/bytecode_3.8_run/08_test_contextmanager.pyc
Normal file
BIN
test/bytecode_3.8_run/08_test_contextmanager.pyc
Normal file
Binary file not shown.
21
test/simple_source/stmts/08_test_contextmanager.py
Normal file
21
test/simple_source/stmts/08_test_contextmanager.py
Normal file
@@ -0,0 +1,21 @@
|
||||
"""
|
||||
This program is self checking!
|
||||
"""
|
||||
|
||||
|
||||
class TestContextManager:
|
||||
def __enter__(self):
|
||||
return 1, 2
|
||||
|
||||
def __exit__(self, exc_type, exc_value, exc_tb):
|
||||
return self, exc_type, exc_value, exc_tb
|
||||
|
||||
|
||||
with open(__file__) as a:
|
||||
assert a
|
||||
|
||||
with open(__file__) as a, open(__file__) as b:
|
||||
assert a.read() == b.read()
|
||||
|
||||
with TestContextManager() as a, b:
|
||||
assert (a, b) == (1, 2)
|
Reference in New Issue
Block a user