summaryrefslogtreecommitdiffstats
path: root/Lib/contextlib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-06-01 08:00:15 (GMT)
committerGitHub <noreply@github.com>2019-06-01 08:00:15 (GMT)
commit2085bd0877e17ad4d98a4586d5eabb6faecbb190 (patch)
treec25b20d33ebf4d64a28abb8591f4ff7acf90614c /Lib/contextlib.py
parent4a686504eb2bbf69adf78077458508a7ba131667 (diff)
downloadcpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.zip
cpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.tar.gz
cpython-2085bd0877e17ad4d98a4586d5eabb6faecbb190.tar.bz2
bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-13700)
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r--Lib/contextlib.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index de989a0..94dc2bf 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -377,8 +377,7 @@ class _BaseExitStack:
return MethodType(cm_exit, cm)
@staticmethod
- def _create_cb_wrapper(*args, **kwds):
- callback, *args = args
+ def _create_cb_wrapper(callback, /, *args, **kwds):
def _exit_wrapper(exc_type, exc, tb):
callback(*args, **kwds)
return _exit_wrapper
@@ -553,8 +552,7 @@ class AsyncExitStack(_BaseExitStack, AbstractAsyncContextManager):
return MethodType(cm_exit, cm)
@staticmethod
- def _create_async_cb_wrapper(*args, **kwds):
- callback, *args = args
+ def _create_async_cb_wrapper(callback, /, *args, **kwds):
async def _exit_wrapper(exc_type, exc, tb):
await callback(*args, **kwds)
return _exit_wrapper