diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-01 02:10:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-01 02:10:53 +0100 |
commit | e64a00332385d749d9c778f93421610ceb1eab54 (patch) | |
tree | 842b124b449f1741d2070b7d4981da0bd95bfd64 /g4f/Provider/base_provider.py | |
parent | Merge pull request #1413 from hlohaus/lia (diff) | |
parent | Patch event loop on win, Check event loop closed (diff) | |
download | gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar.gz gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar.bz2 gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar.lz gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar.xz gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.tar.zst gpt4free-e64a00332385d749d9c778f93421610ceb1eab54.zip |
Diffstat (limited to 'g4f/Provider/base_provider.py')
-rw-r--r-- | g4f/Provider/base_provider.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/g4f/Provider/base_provider.py b/g4f/Provider/base_provider.py index f3959634..62029f5d 100644 --- a/g4f/Provider/base_provider.py +++ b/g4f/Provider/base_provider.py @@ -13,6 +13,13 @@ if sys.version_info < (3, 10): else: from types import NoneType +# Change event loop policy on windows for curl_cffi +if sys.platform == 'win32': + if isinstance( + asyncio.get_event_loop_policy(), asyncio.WindowsProactorEventLoopPolicy + ): + asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy()) + class BaseProvider(ABC): url: str working: bool = False |