diff --git a/python-urllib3.spec b/python-urllib3.spec index 6f8e194..cdc112b 100644 --- a/python-urllib3.spec +++ b/python-urllib3.spec @@ -34,6 +34,8 @@ License: MIT Group: Development/Languages/Python URL: https://urllib3.readthedocs.org/ Source: https://files.pythonhosted.org/packages/source/u/urllib3/urllib3-%{version}.tar.gz +# Wrapper for ssl to unbundle ssl_match_hostname +Source1: ssl_match_hostname_py3.py # PATCH-FIX-UPSTREAM remove_mock.patch gh#urllib3/urllib3#2108 mcepl@suse.com # remove dependency on the external module mock Patch0: remove_mock.patch @@ -109,6 +111,11 @@ rm -r test/appengine/ # Unbundle the Python 3 build rm %{buildroot}/%{python3_sitelib}/urllib3/packages/six.py +rm -r %{buildroot}/%{python3_sitelib}/urllib3/util/ssl_match_hostname.py + +# Copy ssl_match_hostname.py before compilation, so we can have a pyc too +cp -a %{SOURCE1} %{buildroot}/%{python3_sitelib}/urllib3/util/ssl_match_hostname.py + %{python_expand \ $python -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ $python -O -m compileall -d %{$python_sitelib} %{buildroot}%{$python_sitelib}/urllib3/ diff --git a/ssl_match_hostname_py3.py b/ssl_match_hostname_py3.py new file mode 100644 index 0000000..963d16e --- /dev/null +++ b/ssl_match_hostname_py3.py @@ -0,0 +1 @@ +from ssl import match_hostname, CertificateError