@@ -301,7 +301,7 @@ def _response_event(self, response: Response) -> None:
301301
302302 def download2fp (self , url_path : str , fp , dav : bool , params = None , ** kwargs ):
303303 adapter = self .adapter_dav if dav else self .adapter
304- with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" , None )) as response :
304+ with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" )) as response :
305305 check_error (response )
306306 for data_chunk in response .iter_raw (chunk_size = kwargs .get ("chunk_size" , 5 * 1024 * 1024 )):
307307 fp .write (data_chunk )
@@ -425,7 +425,7 @@ async def _response_event(self, response: Response) -> None:
425425
426426 async def download2fp (self , url_path : str , fp , dav : bool , params = None , ** kwargs ):
427427 adapter = self .adapter_dav if dav else self .adapter
428- async with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" , None )) as response :
428+ async with adapter .stream ("GET" , url_path , params = params , headers = kwargs .get ("headers" )) as response :
429429 check_error (response )
430430 async for data_chunk in response .aiter_raw (chunk_size = kwargs .get ("chunk_size" , 5 * 1024 * 1024 )):
431431 fp .write (data_chunk )
0 commit comments