mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-11-13 22:15:26 +00:00
Merge remote-tracking branch 'server/master'
This commit is contained in:
commit
9f6afe89ca
1 file changed
+7
-1
@@ -358,7 +358,7 @@ class ProgressBar:
|
||||
__spin = -1
|
||||
def start(self, progress_function):
|
||||
if self.__task == None:
|
||||
self.__task = asyncio.create_task(self.show(progress_function))
|
||||
self.__task = asyncio_create_task(self.show(progress_function))
|
||||
async def show(self, progress_function):
|
||||
if not self.enabled:
|
||||
return
|
||||
@@ -389,6 +389,12 @@ class ProgressBar:
|
||||
await self.__task
|
||||
self.__task = None
|
||||
|
||||
def asyncio_create_task(coro):
|
||||
if version_info >= (3, 7):
|
||||
return asyncio.create_task(coro)
|
||||
loop = asyncio.get_event_loop()
|
||||
return loop.create_task(coro)
|
||||
|
||||
def asyncio_run(aw): #https://stackoverflow.com/questions/55590343/asyncio-run-or-run-until-complete
|
||||
if version_info >= (3, 7):
|
||||
return asyncio.run(aw)
|
||||
|
||||
Reference in new issue
Block a user