Commit c0241921 authored by Maurits van Rees's avatar Maurits van Rees Committed by Godefroid Chapelle

Fix TypeError for missing required `use_deprecated_html5lib` with pip 22.

Keep compatible with earlier pip versions.
Fixes https://github.com/buildout/buildout/issues/598
parent 2a91e9f4
Fix TypeError for missing required `use_deprecated_html5lib` with pip 22.
Keep compatible with earlier pip versions.
...@@ -119,7 +119,13 @@ def patch_PackageIndex(): ...@@ -119,7 +119,13 @@ def patch_PackageIndex():
except TypeError: except TypeError:
html_page = HTMLPage(page, charset, base) html_page = HTMLPage(page, charset, base)
plinks = list(parse_links(html_page)) # https://github.com/buildout/buildout/issues/598
# use_deprecated_html5lib is a required addition in pip 22.
try:
plinks = parse_links(html_page, use_deprecated_html5lib=False)
except TypeError:
plinks = parse_links(html_page)
plinks = list(plinks)
pip_links = [l.url for l in plinks] pip_links = [l.url for l in plinks]
# --- END OF LOCAL CHANGES --- # --- END OF LOCAL CHANGES ---
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment