mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-13 23:03:09 +00:00
use asyncio.all_tasks on new pythons
This commit is contained in:
@@ -2260,7 +2260,13 @@ def main():
|
||||
except KeyboardInterrupt:
|
||||
pass
|
||||
|
||||
for task in asyncio.Task.all_tasks():
|
||||
try:
|
||||
tasks = asyncio.all_tasks(loop)
|
||||
except AttributeError:
|
||||
# for compatibility with python 3.6
|
||||
tasks = asyncio.Task.all_tasks(loop)
|
||||
|
||||
for task in tasks:
|
||||
task.cancel()
|
||||
|
||||
for server in servers:
|
||||
|
||||
Reference in New Issue
Block a user