mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-23 16:24:18 +00:00
simplify porting to Python 3
This commit is contained in:
parent
86a6d6898b
commit
220ced163c
@ -276,7 +276,7 @@ class FilesPipeline(MediaPipeline):
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
|
||||
# check if called from file_key with url as first argument
|
||||
if isinstance(request, unicode) or isinstance(request, str):
|
||||
if not isinstance(request, Request):
|
||||
_warn()
|
||||
url = request
|
||||
else:
|
||||
|
@ -118,7 +118,7 @@ class ImagesPipeline(FilesPipeline):
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
|
||||
# check if called from image_key or file_key with url as first argument
|
||||
if isinstance(request, unicode) or isinstance(request, str):
|
||||
if not isinstance(request, Request):
|
||||
_warn()
|
||||
url = request
|
||||
else:
|
||||
@ -146,7 +146,7 @@ class ImagesPipeline(FilesPipeline):
|
||||
category=ScrapyDeprecationWarning, stacklevel=1)
|
||||
|
||||
# check if called from thumb_key with url as first argument
|
||||
if isinstance(request, unicode) or isinstance(request, str):
|
||||
if not isinstance(request, Request):
|
||||
_warn()
|
||||
url = request
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user