Fix the call of iscoroutinefunction()
This commit is contained in:
parent
1207c81ab5
commit
225e07eb64
1 changed files with 2 additions and 2 deletions
|
@ -7,12 +7,12 @@ call_soon() ones. These callback are called only once each.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
from asyncio import tasks, events
|
from asyncio import events
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
|
|
||||||
def idle_call(self, callback):
|
def idle_call(self, callback):
|
||||||
if tasks.iscoroutinefunction(callback):
|
if asyncio.iscoroutinefunction(callback):
|
||||||
raise TypeError("coroutines cannot be used with idle_call()")
|
raise TypeError("coroutines cannot be used with idle_call()")
|
||||||
handle = events.Handle(callback, [], self)
|
handle = events.Handle(callback, [], self)
|
||||||
self._idle.append(handle)
|
self._idle.append(handle)
|
||||||
|
|
Loading…
Reference in a new issue