From 7c753adbe532f1a027d1d285a7c1e4b59fd9e5a8 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 24 Jan 2023 23:05:17 -0800 Subject: [PATCH] revert mypy fix didn't work --- scrapy/pipelines/files.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scrapy/pipelines/files.py b/scrapy/pipelines/files.py index 6a32c8b47..a5948525a 100644 --- a/scrapy/pipelines/files.py +++ b/scrapy/pipelines/files.py @@ -36,7 +36,7 @@ from scrapy.utils.request import referer_str logger = logging.getLogger(__name__) -def _to_string(path: Union[str, os.PathLike[str]]): +def _to_string(path: Union[str, os.PathLike]): return str(path) # convert a Path object to string @@ -45,7 +45,7 @@ class FileException(Exception): class FSFilesStore: - def __init__(self, basedir: Union[str, os.PathLike[str]]): + def __init__(self, basedir: Union[str, os.PathLike]): basedir = _to_string(basedir) if '://' in basedir: basedir = basedir.split('://', 1)[1] @@ -70,7 +70,7 @@ class FSFilesStore: return {'last_modified': last_modified, 'checksum': checksum} - def _get_filesystem_path(self, path: Union[str, os.PathLike[str]]) -> Path: + def _get_filesystem_path(self, path: Union[str, os.PathLike]) -> Path: path_comps = _to_string(path).split('/') return Path(self.basedir, *path_comps)