style: using isinstance function as the main way for type checking
This commit is contained in:
@@ -240,7 +240,7 @@ class ResponseFactory:
|
||||
return Response(
|
||||
url=response.url,
|
||||
content=response.content
|
||||
if type(response.content) is bytes
|
||||
if isinstance(response.content, bytes)
|
||||
else response.content.encode(),
|
||||
status=response.status_code,
|
||||
reason=response.reason,
|
||||
|
||||
@@ -216,7 +216,7 @@ class BaseFetcher:
|
||||
storage_args=cls.storage_args,
|
||||
)
|
||||
if cls.adaptive_domain:
|
||||
if type(cls.adaptive_domain) is not str:
|
||||
if not isinstance(cls.adaptive_domain, str):
|
||||
log.warning(
|
||||
'[Ignored] The argument "adaptive_domain" must be of string type'
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user