1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00

Remove skip_archives argument

This commit is contained in:
Tzu-ping Chung 2018-09-27 15:41:02 +08:00
parent 1a1695e022
commit 894f6558f1

View file

@ -731,7 +731,7 @@ class HTMLPage(object):
return self.url
@classmethod
def get_page(cls, link, skip_archives=True, session=None):
def get_page(cls, link, session=None):
if session is None:
raise TypeError(
"get_page() missing 1 required keyword argument: 'session'"
@ -748,22 +748,21 @@ class HTMLPage(object):
return None
try:
if skip_archives:
filename = link.filename
for bad_ext in ARCHIVE_EXTENSIONS:
if filename.endswith(bad_ext):
content_type = cls._get_content_type(
url, session=session,
filename = link.filename
for bad_ext in ARCHIVE_EXTENSIONS:
if filename.endswith(bad_ext):
content_type = cls._get_content_type(
url, session=session,
)
if content_type.lower().startswith('text/html'):
break
else:
logger.debug(
'Skipping page %s because of Content-Type: %s',
link,
content_type,
)
if content_type.lower().startswith('text/html'):
break
else:
logger.debug(
'Skipping page %s because of Content-Type: %s',
link,
content_type,
)
return
return
logger.debug('Getting page %s', url)