scrapy.utils.data_path type hint change (#6133)

This commit is contained in:
cakemd 2023-11-06 09:37:18 +02:00 committed by GitHub
parent 6587556af9
commit eafe828484
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
import os
import warnings
from importlib import import_module
from os import PathLike
from pathlib import Path
from typing import Union
from scrapy.exceptions import NotConfigured
from scrapy.settings import Settings
@ -44,7 +46,7 @@ def project_data_dir(project: str = "default") -> str:
return str(d)
def data_path(path: str, createdir: bool = False) -> str:
def data_path(path: Union[str, PathLike], createdir: bool = False) -> str:
"""
Return the given path joined with the .scrapy data directory.
If given an absolute path, return it unmodified.