Restore ssl_match_hostname unbundle wrapper

This is to prevent pipenv failure when it creates Pipfile.lock in Python2 environment.
This commit is contained in:
Karolina Surma 2021-06-16 12:42:54 +02:00
parent 70fe2fa552
commit b71ec3d8c8
2 changed files with 5 additions and 2 deletions

View File

@ -11,6 +11,8 @@ Summary: Python HTTP library with thread-safe connection pooling and file
License: MIT License: MIT
URL: https://github.com/urllib3/urllib3 URL: https://github.com/urllib3/urllib3
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
# Unbundle ssl_match_hostname since we depend on it
Source1: ssl_match_hostname_py3.py
BuildArch: noarch BuildArch: noarch
%description %description
@ -90,10 +92,10 @@ sed -i -e 's/^import mock/from unittest import mock/' \
# Unbundle the Python 3 build # Unbundle the Python 3 build
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six.* rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/six.*
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/_implementation.py rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/
rm -rf %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname/__pycache__/_implementation.*
mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/ mkdir -p %{buildroot}/%{python3_sitelib}/urllib3/packages/
cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/packages/ssl_match_hostname.py
ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py ln -s %{python3_sitelib}/six.py %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py
ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \ ln -s %{python3_sitelib}/__pycache__/six.cpython-%{python3_version_nodots}.opt-1.pyc \
%{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/ %{buildroot}/%{python3_sitelib}/urllib3/packages/__pycache__/

View File

@ -0,0 +1 @@
from ssl import match_hostname, CertificateError