aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Galindo <Pablogsal@gmail.com>2020-05-06 22:54:34 +0100
committerGitHub <noreply@github.com>2020-05-06 22:54:34 +0100
commit99db2a1db7a9b468a0ce8377d579f78fa03a2a34 (patch)
tree5752707eb45888e127ba1ae74721f2237a878f97 /Grammar
parentFix typo in sqlite3 documentation (GH-19965) (diff)
downloadcpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.tar.gz
cpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.tar.bz2
cpython-99db2a1db7a9b468a0ce8377d579f78fa03a2a34.zip
bpo-40334: Allow trailing comma in parenthesised context managers (GH-19964)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/python.gram4
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/python.gram b/Grammar/python.gram
index 3f16768198f..3d8a39b1d59 100644
--- a/Grammar/python.gram
+++ b/Grammar/python.gram
@@ -170,11 +170,11 @@ for_stmt[stmt_ty]:
CHECK_VERSION(5, "Async for loops are", _Py_AsyncFor(t, ex, b, el, NEW_TYPE_COMMENT(p, tc), EXTRA)) }
with_stmt[stmt_ty]:
- | 'with' '(' a=','.with_item+ ')' ':' b=block {
+ | 'with' '(' a=','.with_item+ ','? ')' ':' b=block {
_Py_With(a, b, NULL, EXTRA) }
| 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {
_Py_With(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) }
- | ASYNC 'with' '(' a=','.with_item+ ')' ':' b=block {
+ | ASYNC 'with' '(' a=','.with_item+ ','? ')' ':' b=block {
CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NULL, EXTRA)) }
| ASYNC 'with' a=','.with_item+ ':' tc=[TYPE_COMMENT] b=block {
CHECK_VERSION(5, "Async with statements are", _Py_AsyncWith(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA)) }