Skip to content

Commit 1041b90

Browse files
committed
_prepare_credentials: connector fix for fsspec>=2022.12
1 parent fe2ae8e commit 1041b90

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

dvc_http/__init__.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class HTTPFileSystem(FileSystem):
4040

4141
def _prepare_credentials(self, **config):
4242
import aiohttp
43-
from fsspec.asyn import fsspec_loop
4443

4544
credentials = {}
4645
client_kwargs = credentials.setdefault("client_kwargs", {})
@@ -81,10 +80,10 @@ def _prepare_credentials(self, **config):
8180
if "ssl_verify" in config:
8281
connector_kwargs.update(ssl=make_context(config["ssl_verify"]))
8382

84-
with fsspec_loop():
85-
client_kwargs["connector"] = aiohttp.TCPConnector(
86-
**connector_kwargs
87-
)
83+
client_kwargs["connector"] = aiohttp.TCPConnector(
84+
loop=self.fs.loop, **connector_kwargs
85+
)
86+
8887
# The connector should not be owned by aiohttp.ClientSession since
8988
# it is closed by fsspec (HTTPFileSystem.close_session)
9089
client_kwargs["connector_owner"] = False

0 commit comments

Comments
 (0)