mirror of https://github.com/scrapy/scrapy.git
_is_path → _is_filesystem_path
This commit is contained in:
parent
d54c4496ee
commit
53c323b19d
|
|
@ -121,14 +121,14 @@ def _is_windows_path(string):
|
|||
)
|
||||
|
||||
|
||||
def _is_path(string):
|
||||
def _is_filesystem_path(string):
|
||||
return _is_posix_path(string) or _is_windows_path(string)
|
||||
|
||||
|
||||
def guess_scheme(url):
|
||||
"""Add an URL scheme if missing: file:// for filepath-like input or
|
||||
http:// otherwise."""
|
||||
if _is_path(url):
|
||||
if _is_filesystem_path(url):
|
||||
return any_to_uri(url)
|
||||
return add_http_if_no_scheme(url)
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from scrapy.spiders import Spider
|
|||
from scrapy.utils.url import (
|
||||
add_http_if_no_scheme,
|
||||
guess_scheme,
|
||||
_is_path,
|
||||
_is_filesystem_path,
|
||||
strip_url,
|
||||
url_is_from_any_domain,
|
||||
url_is_from_spider,
|
||||
|
|
@ -460,7 +460,7 @@ class IsPathTestCase(unittest.TestCase):
|
|||
|
||||
(r"https://example.com", False),
|
||||
):
|
||||
self.assertEqual(_is_path(input_value), output_value, input_value)
|
||||
self.assertEqual(_is_filesystem_path(input_value), output_value, input_value)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
|
|||
Loading…
Reference in New Issue