Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b420b3e

Browse files
martinRenoutacaswell
authored andcommitted
create_task -> ensure_future so that it works also if there is no event
loop
1 parent abd9efe commit b420b3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/backends/backend_webagg_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ async def _timer_task(self, interval):
9797
def _timer_start(self):
9898
self._timer_stop()
9999

100-
self._task = asyncio.create_task(
100+
self._task = asyncio.ensure_future(
101101
self._timer_task(max(self.interval / 1_000., 1e-6))
102102
)
103103

0 commit comments

Comments
 (0)