diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2019-06-05 15:22:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-05 15:22:31 (GMT) |
commit | 142566c028720934325f0b7fe28680afd046e00f (patch) | |
tree | 021875972731bf9271bf07cc05d17f15866ded7a /Lib/curses | |
parent | 6c01ebcc0dfc6be22950fabb46bdc10dcb6202c9 (diff) | |
download | cpython-142566c028720934325f0b7fe28680afd046e00f.zip cpython-142566c028720934325f0b7fe28680afd046e00f.tar.gz cpython-142566c028720934325f0b7fe28680afd046e00f.tar.bz2 |
[3.9] bpo-37116: Use PEP 570 syntax for positional-only parameters. (GH-12620)
Turn deprecation warnings added in 3.8 into TypeError.
Diffstat (limited to 'Lib/curses')
-rw-r--r-- | Lib/curses/__init__.py | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/Lib/curses/__init__.py b/Lib/curses/__init__.py index 24ff3ca..69270bf 100644 --- a/Lib/curses/__init__.py +++ b/Lib/curses/__init__.py @@ -60,7 +60,7 @@ except NameError: # raises an exception, wrapper() will restore the terminal to a sane state so # you can read the resulting traceback. -def wrapper(*args, **kwds): +def wrapper(func, /, *args, **kwds): """Wrapper function that initializes curses and calls another function, restoring normal keyboard/screen behavior on error. The callable object 'func' is then passed the main window 'stdscr' @@ -68,17 +68,6 @@ def wrapper(*args, **kwds): wrapper(). """ - if args: - func, *args = args - elif 'func' in kwds: - func = kwds.pop('func') - import warnings - warnings.warn("Passing 'func' as keyword argument is deprecated", - DeprecationWarning, stacklevel=2) - else: - raise TypeError('wrapper expected at least 1 positional argument, ' - 'got %d' % len(args)) - try: # Initialize curses stdscr = initscr() @@ -110,4 +99,3 @@ def wrapper(*args, **kwds): echo() nocbreak() endwin() -wrapper.__text_signature__ = '(func, /, *args, **kwds)' |