From c8a971299dfada85ddcdd657d097b4c17e7d9def Mon Sep 17 00:00:00 2001 From: Wesley van Lee Date: Fri, 4 Oct 2024 14:32:05 +0200 Subject: [PATCH] Resolve Mypy errors --- scrapy_webarchive/downloadermiddlewares.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scrapy_webarchive/downloadermiddlewares.py b/scrapy_webarchive/downloadermiddlewares.py index 893ea4e..c199b25 100644 --- a/scrapy_webarchive/downloadermiddlewares.py +++ b/scrapy_webarchive/downloadermiddlewares.py @@ -1,5 +1,5 @@ import re -from typing import Iterable +from typing import Iterable, Union from urllib.parse import urlparse from scrapy import signals @@ -45,6 +45,7 @@ def from_crawler(cls, crawler: Crawler) -> Self: def spider_opened(self, spider: Spider) -> None: tp = {"timeout": self.timeout} + self.wacz: Union[WaczFile, MultiWaczFile] if len(self.wacz_urls) == 1: spider.logger.info(f"[WACZDownloader] Opening WACZ {self.wacz_urls[0]}")