use running loop if possible
This commit is contained in:
parent
e6fbab30aa
commit
79fb296a6e
1 changed files with 5 additions and 2 deletions
|
@ -219,6 +219,9 @@ class UPnP:
|
||||||
kwargs: dict = None) -> None:
|
kwargs: dict = None) -> None:
|
||||||
kwargs = kwargs or {}
|
kwargs = kwargs or {}
|
||||||
|
|
||||||
|
try:
|
||||||
|
asyncio.get_running_loop()
|
||||||
|
except RuntimeError:
|
||||||
loop = asyncio.new_event_loop()
|
loop = asyncio.new_event_loop()
|
||||||
asyncio.set_event_loop(loop)
|
asyncio.set_event_loop(loop)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue