mirror of
https://github.com/python/cpython.git
synced 2025-07-30 22:54:16 +00:00
Allow multiple context managers in one with statement, as proposed
in http://codereview.appspot.com/53094 and accepted by Guido. The construct is transformed into multiple With AST nodes so that there should be no problems with the semantics.
This commit is contained in:
parent
04516611e7
commit
944f684ce6
11 changed files with 216 additions and 71 deletions
|
@ -199,6 +199,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
|
|||
def test_with(self):
|
||||
self.check_suite("with open('x'): pass\n")
|
||||
self.check_suite("with open('x') as f: pass\n")
|
||||
self.check_suite("with open('x') as f, open('y') as g: pass\n")
|
||||
|
||||
def test_try_stmt(self):
|
||||
self.check_suite("try: pass\nexcept: pass\n")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue