Skip to content

Commit

Permalink
Merge pull request #9571 from jdufresne/unescape
Browse files Browse the repository at this point in the history
Remove outdated compat shim for stdlib html.unescape
  • Loading branch information
pradyunsg authored Feb 21, 2021
2 parents 599fc57 + 2fdb7de commit e17ddea
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/pip/_internal/index/collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import cgi
import functools
import html
import itertools
import logging
import mimetypes
Expand All @@ -26,7 +27,6 @@
)

from pip._vendor import html5lib, requests
from pip._vendor.distlib.compat import unescape
from pip._vendor.requests import Response
from pip._vendor.requests.exceptions import RetryError, SSLError

Expand Down Expand Up @@ -261,12 +261,11 @@ def _create_link_from_element(

url = _clean_link(urllib.parse.urljoin(base_url, href))
pyrequire = anchor.get('data-requires-python')
pyrequire = unescape(pyrequire) if pyrequire else None
pyrequire = html.unescape(pyrequire) if pyrequire else None

yanked_reason = anchor.get('data-yanked')
if yanked_reason:
# This is a unicode string in Python 2 (and 3).
yanked_reason = unescape(yanked_reason)
yanked_reason = html.unescape(yanked_reason)

link = Link(
url,
Expand Down

0 comments on commit e17ddea

Please sign in to comment.