1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-28 15:07:05 +00:00

issue GH #1550 - six library is used instead of urlparse for python3 compatibility

This commit is contained in:
Leonid Amirov 2015-11-03 14:57:37 +03:00
parent dd45b31fe4
commit 97b51ea33b

View File

@ -4,8 +4,9 @@ Scrapy Shell
See documentation in docs/topics/shell.rst
"""
import re
from six.moves.urllib.parse import urlparse, urlunparse
from threading import Thread
import urlparse
from w3lib.url import any_to_uri
from scrapy.commands import ScrapyCommand
@ -45,7 +46,7 @@ class Command(ScrapyCommand):
def run(self, args, opts):
url = args[0] if args else None
if url:
parts = urlparse.urlsplit(url)
parts = urlparse(url)
if not parts.scheme:
if "." not in parts.path.split("/", 1)[0]:
url = any_to_uri(url)