diff options
Diffstat (limited to 'Lib/types.py')
-rw-r--r-- | Lib/types.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Lib/types.py b/Lib/types.py index 37ba4bb1f4..ea3c0b29d5 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -262,14 +262,8 @@ def coroutine(func): if co_flags & 0x20: # TODO: Implement this in C. co = func.__code__ - func.__code__ = CodeType( - co.co_argcount, co.co_posonlyargcount, co.co_kwonlyargcount, co.co_nlocals, - co.co_stacksize, - co.co_flags | 0x100, # 0x100 == CO_ITERABLE_COROUTINE - co.co_code, - co.co_consts, co.co_names, co.co_varnames, co.co_filename, - co.co_name, co.co_firstlineno, co.co_lnotab, co.co_freevars, - co.co_cellvars) + # 0x100 == CO_ITERABLE_COROUTINE + func.__code__ = co.replace(co_flags=co.co_flags | 0x100) return func # The following code is primarily to support functions that |