Fix support for Python 3.10

Signed-off-by: rany2 <rany2@riseup.net>
This commit is contained in:
rany2
2023-06-02 20:03:37 +03:00
parent 0094e3b952
commit ca6e7b0669
5 changed files with 20 additions and 15 deletions

View File

@@ -17,7 +17,8 @@ OUTPUT_FILE = "test.mp3"
WEBVTT_FILE = "test.vtt"
async def _main() -> None:
async def amain() -> None:
"""Main function"""
communicate = edge_tts.Communicate(TEXT, VOICE)
submaker = edge_tts.SubMaker()
with open(OUTPUT_FILE, "wb") as file:
@@ -32,8 +33,8 @@ async def _main() -> None:
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop = asyncio.get_event_loop_policy().get_event_loop()
try:
loop.run_until_complete(_main())
loop.run_until_complete(amain())
finally:
loop.close()