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
|
import asyncio
|
||||||
try:
|
try:
|
||||||
import nest_asyncio
|
import nest_asyncio2 as nest_asyncio
|
||||||
has_nest_asyncio = True
|
has_nest_asyncio = True
|
||||||
except:
|
except:
|
||||||
has_nest_asyncio = False
|
has_nest_asyncio = False
|
||||||
|
|||||||
+1
-1
@@ -49,7 +49,7 @@ class MissingRequirementsError(G4FError):
|
|||||||
|
|
||||||
|
|
||||||
class NestAsyncioError(MissingRequirementsError):
|
class NestAsyncioError(MissingRequirementsError):
|
||||||
"""Raised when 'nest_asyncio' is missing."""
|
"""Raised when 'nest_asyncio2' is missing."""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from typing import Optional, Callable, AsyncIterator, Iterator
|
|||||||
from ..errors import NestAsyncioError
|
from ..errors import NestAsyncioError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import nest_asyncio
|
import nest_asyncio2 as nest_asyncio
|
||||||
has_nest_asyncio = True
|
has_nest_asyncio = True
|
||||||
except ImportError:
|
except ImportError:
|
||||||
has_nest_asyncio = False
|
has_nest_asyncio = False
|
||||||
@@ -28,7 +28,7 @@ def get_running_loop(check_nested: bool) -> Optional[AbstractEventLoop]:
|
|||||||
if has_nest_asyncio:
|
if has_nest_asyncio:
|
||||||
nest_asyncio.apply(loop)
|
nest_asyncio.apply(loop)
|
||||||
elif check_nested:
|
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
|
return loop
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -2,4 +2,4 @@ requests
|
|||||||
aiohttp
|
aiohttp
|
||||||
brotli
|
brotli
|
||||||
pycryptodome
|
pycryptodome
|
||||||
nest_asyncio
|
nest-asyncio2
|
||||||
@@ -3,7 +3,7 @@ pycryptodome
|
|||||||
curl_cffi>=0.6.2
|
curl_cffi>=0.6.2
|
||||||
aiohttp
|
aiohttp
|
||||||
certifi
|
certifi
|
||||||
nest_asyncio
|
nest-asyncio2
|
||||||
werkzeug
|
werkzeug
|
||||||
pillow
|
pillow
|
||||||
fastapi
|
fastapi
|
||||||
|
|||||||
+1
-1
@@ -4,7 +4,7 @@ curl_cffi>=0.6.2
|
|||||||
aiohttp
|
aiohttp
|
||||||
certifi
|
certifi
|
||||||
browser_cookie3
|
browser_cookie3
|
||||||
nest_asyncio
|
nest-asyncio2
|
||||||
werkzeug
|
werkzeug
|
||||||
pillow
|
pillow
|
||||||
platformdirs
|
platformdirs
|
||||||
|
|||||||
Reference in New Issue
Block a user