mirror of
https://github.com/xtekky/gpt4free.git
synced 2026-04-22 15:47:11 +08:00
fix: Update references from 'nest_asyncio' to 'nest-asyncio2' across the codebase
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import asyncio
|
||||
try:
|
||||
import nest_asyncio
|
||||
import nest_asyncio2 as nest_asyncio
|
||||
has_nest_asyncio = True
|
||||
except:
|
||||
has_nest_asyncio = False
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ class MissingRequirementsError(G4FError):
|
||||
|
||||
|
||||
class NestAsyncioError(MissingRequirementsError):
|
||||
"""Raised when 'nest_asyncio' is missing."""
|
||||
"""Raised when 'nest_asyncio2' is missing."""
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ from typing import Optional, Callable, AsyncIterator, Iterator
|
||||
from ..errors import NestAsyncioError
|
||||
|
||||
try:
|
||||
import nest_asyncio
|
||||
import nest_asyncio2 as nest_asyncio
|
||||
has_nest_asyncio = True
|
||||
except ImportError:
|
||||
has_nest_asyncio = False
|
||||
@@ -28,7 +28,7 @@ def get_running_loop(check_nested: bool) -> Optional[AbstractEventLoop]:
|
||||
if has_nest_asyncio:
|
||||
nest_asyncio.apply(loop)
|
||||
elif check_nested:
|
||||
raise NestAsyncioError('Install "nest_asyncio" package | pip install -U nest_asyncio')
|
||||
raise NestAsyncioError('Install "nest-asyncio2" package | pip install -U nest-asyncio2')
|
||||
return loop
|
||||
except RuntimeError:
|
||||
pass
|
||||
|
||||
@@ -2,4 +2,4 @@ requests
|
||||
aiohttp
|
||||
brotli
|
||||
pycryptodome
|
||||
nest_asyncio
|
||||
nest-asyncio2
|
||||
@@ -3,7 +3,7 @@ pycryptodome
|
||||
curl_cffi>=0.6.2
|
||||
aiohttp
|
||||
certifi
|
||||
nest_asyncio
|
||||
nest-asyncio2
|
||||
werkzeug
|
||||
pillow
|
||||
fastapi
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ curl_cffi>=0.6.2
|
||||
aiohttp
|
||||
certifi
|
||||
browser_cookie3
|
||||
nest_asyncio
|
||||
nest-asyncio2
|
||||
werkzeug
|
||||
pillow
|
||||
platformdirs
|
||||
|
||||
Reference in New Issue
Block a user