Commit 5430b81e authored by Stefan Behnel's avatar Stefan Behnel

use correct metaclass when patching Coroutine into collections.abc module

parent b9e0bdcf
......@@ -1215,14 +1215,18 @@ _module.Generator = mk_gen()
#ifdef __Pyx_Coroutine_USED
CSTRING("""\
def mk_coroutine():
from abc import abstractmethod
from abc import abstractmethod, ABCMeta
""")
#if PY_MAJOR_VERSION >= 3
" class Coroutine(metaclass=_module.ABCMeta):\n"
CSTRING("""\
class Coroutine(metaclass=ABCMeta):
""")
#else
" class Coroutine(object):\n"
" __metaclass__ = _module.ABCMeta\n"
CSTRING("""\
class Coroutine(object):
__metaclass__ = ABCMeta
""")
#endif
CSTRING("""\
__slots__ = ()
......@@ -1259,10 +1263,14 @@ def mk_coroutine():
""")
#if PY_MAJOR_VERSION >= 3
" class Awaitable(metaclass=_module.ABCMeta):\n"
CSTRING("""\
class Awaitable(metaclass=ABCMeta):
""")
#else
" class Awaitable(object):\n"
" __metaclass__ = _module.ABCMeta\n"
CSTRING("""\
class Awaitable(object):
__metaclass__ = ABCMeta
""")
#endif
CSTRING("""\
__slots__ = ()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment