try this?
This commit is contained in:
parent
f8b52eb8c5
commit
0b95b49401
|
@ -22,6 +22,7 @@ them.
|
|||
See doc/log_contexts.rst for details on how this works.
|
||||
"""
|
||||
|
||||
import types
|
||||
import logging
|
||||
import threading
|
||||
|
||||
|
@ -544,6 +545,9 @@ def run_in_background(f, *args, **kwargs):
|
|||
# by synchronous exceptions, so let's turn them into Failures.
|
||||
return defer.fail()
|
||||
|
||||
if isinstance(res, types.CoroutineType):
|
||||
res = defer.ensureDeferred(res)
|
||||
|
||||
if not isinstance(res, defer.Deferred):
|
||||
return res
|
||||
|
||||
|
|
Loading…
Reference in a new issue