We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d345ec3 commit a6fe31dCopy full SHA for a6fe31d
uvloop/_patch.py
@@ -4,10 +4,23 @@
4
5
6
def _format_coroutine(coro):
7
- if asyncio.iscoroutine(coro) and not hasattr(coro, 'cr_code'):
+ if asyncio.iscoroutine(coro) \
8
+ and not hasattr(coro, 'cr_code') \
9
+ and not hasattr(coro, 'gi_code'):
10
+
11
# Most likely a Cython coroutine
12
coro_name = '{}()'.format(coro.__qualname__ or coro.__name__)
- if coro.cr_running:
13
14
+ running = False
15
+ try:
16
+ running = coro.cr_running
17
+ except AttributeError:
18
19
+ running = coro.gi_running
20
21
+ pass
22
23
+ if running:
24
return '{} running'.format(coro_name)
25
else:
26
return coro_name
0 commit comments