diff --git a/examples/input_example.py b/examples/input_example.py index b7d3173..f5a9fa4 100755 --- a/examples/input_example.py +++ b/examples/input_example.py @@ -25,13 +25,4 @@ async def main(): if __name__ == "__main__": - # Fix for "RuntimeError: Event loop is closed" on Windows - # and Python 3.8+ - if ( - os.name == "nt" - and sys.version_info >= (3, 8) - and hasattr(asyncio, "WindowsSelectorEventLoopPolicy") - ): - asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) - asyncio.run(main()) diff --git a/lint.sh b/lint.sh index c2c19a9..08d10a1 100755 --- a/lint.sh +++ b/lint.sh @@ -1,2 +1,2 @@ -find src examples -name '*.py' | xargs black -find src examples -name '*.py' | xargs isort +find src -name '*.py' | xargs black +find src -name '*.py' | xargs isort diff --git a/src/edge_tts/util.py b/src/edge_tts/util.py index f020785..98b4aee 100644 --- a/src/edge_tts/util.py +++ b/src/edge_tts/util.py @@ -5,7 +5,6 @@ Main package. import argparse import asyncio -import os import sys from edge_tts import Communicate, SubMaker, list_voices @@ -154,15 +153,6 @@ def main(): """ Main function. """ - # Fix for "RuntimeError: Event loop is closed" on Windows - # and Python 3.8+ - if ( - os.name == "nt" - and sys.version_info >= (3, 8) - and hasattr(asyncio, "WindowsSelectorEventLoopPolicy") - ): - asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) - asyncio.run(_main())