mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-19 09:05:50 +00:00
use asyncio.all_tasks on new pythons
This commit is contained in:
@@ -2260,7 +2260,13 @@ def main():
|
|||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
pass
|
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()
|
task.cancel()
|
||||||
|
|
||||||
for server in servers:
|
for server in servers:
|
||||||
|
|||||||
Reference in New Issue
Block a user