mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-08-02 19:20:11 +03:00
Update coroutine provider implementation for python 3.4
This commit is contained in:
parent
e03dc770f4
commit
0524c2d790
File diff suppressed because it is too large
Load Diff
|
@ -11,9 +11,16 @@ import threading
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import asyncio
|
import asyncio
|
||||||
import asyncio.coroutines
|
|
||||||
except ImportError:
|
except ImportError:
|
||||||
asyncio = None
|
asyncio = None
|
||||||
|
_is_coroutine_marker = None
|
||||||
|
else:
|
||||||
|
if sys.version_info[0:2] == (3, 4):
|
||||||
|
_is_coroutine_marker = True
|
||||||
|
else:
|
||||||
|
import asyncio.coroutines
|
||||||
|
_is_coroutine_marker = asyncio.coroutines._is_coroutine
|
||||||
|
|
||||||
|
|
||||||
from .errors import (
|
from .errors import (
|
||||||
Error,
|
Error,
|
||||||
|
@ -878,8 +885,7 @@ cdef class Coroutine(Callable):
|
||||||
some_coroutine.add_kwargs(keyword_argument1=3, keyword_argument=4)
|
some_coroutine.add_kwargs(keyword_argument1=3, keyword_argument=4)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if asyncio:
|
_is_coroutine = _is_coroutine_marker
|
||||||
_is_coroutine = asyncio.coroutines._is_coroutine
|
|
||||||
|
|
||||||
def __init__(self, provides, *args, **kwargs):
|
def __init__(self, provides, *args, **kwargs):
|
||||||
"""Initializer.
|
"""Initializer.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user