1919
2020from ._params import _ParamParser
2121from .responses import ZyteAPIResponse , ZyteAPITextResponse , _process_response
22- from .utils import (
22+ from .utils import ( # type: ignore[attr-defined]
2323 _AUTOTHROTTLE_DONT_ADJUST_DELAY_SUPPORT ,
2424 _X402_SUPPORT ,
2525 USER_AGENT ,
@@ -82,7 +82,10 @@ class _ScrapyZyteAPIBaseDownloadHandler:
8282 lazy = False
8383
8484 def __init__ (
85- self , settings : Settings , crawler : Crawler , client : AsyncZyteAPI = None
85+ self ,
86+ settings : Settings ,
87+ crawler : Crawler ,
88+ client : Optional [AsyncZyteAPI ] = None ,
8689 ):
8790 if not settings .getbool ("ZYTE_API_ENABLED" , True ):
8891 raise NotConfigured (
@@ -348,7 +351,10 @@ async def _close(self) -> None: # NOQA
348351
349352class ScrapyZyteAPIDownloadHandler (_ScrapyZyteAPIBaseDownloadHandler ):
350353 def __init__ (
351- self , settings : Settings , crawler : Crawler , client : AsyncZyteAPI = None
354+ self ,
355+ settings : Settings ,
356+ crawler : Crawler ,
357+ client : Optional [AsyncZyteAPI ] = None ,
352358 ):
353359 super ().__init__ (settings , crawler , client )
354360 self ._fallback_handler = self ._create_handler (
@@ -358,7 +364,10 @@ def __init__(
358364
359365class ScrapyZyteAPIHTTPDownloadHandler (_ScrapyZyteAPIBaseDownloadHandler ):
360366 def __init__ (
361- self , settings : Settings , crawler : Crawler , client : AsyncZyteAPI = None
367+ self ,
368+ settings : Settings ,
369+ crawler : Crawler ,
370+ client : Optional [AsyncZyteAPI ] = None ,
362371 ):
363372 super ().__init__ (settings , crawler , client )
364373 self ._fallback_handler = self ._create_handler (
@@ -371,7 +380,10 @@ def __init__(
371380
372381class ScrapyZyteAPIHTTPSDownloadHandler (_ScrapyZyteAPIBaseDownloadHandler ):
373382 def __init__ (
374- self , settings : Settings , crawler : Crawler , client : AsyncZyteAPI = None
383+ self ,
384+ settings : Settings ,
385+ crawler : Crawler ,
386+ client : Optional [AsyncZyteAPI ] = None ,
375387 ):
376388 super ().__init__ (settings , crawler , client )
377389 self ._fallback_handler = self ._create_handler (
0 commit comments