Skip to content

Commit e46f82e

Browse files
committed
Add iscoroutine with replacement for older pythons
1 parent 0e4d0ea commit e46f82e

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

memory_profiler.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@
2929
import psutil
3030

3131

32+
if sys.version_info > (3, 3):
33+
if sys.version_info < (3, 5):
34+
from asyncio import iscoroutinefunction
35+
else:
36+
from inspect import iscoroutinefunction
37+
else:
38+
def iscoroutinefunction(_):
39+
return False
40+
41+
3242
# TODO: provide alternative when multiprocessing is not available
3343
try:
3444
from multiprocessing import Process, Pipe

0 commit comments

Comments
 (0)