From ab05b25e9f364f36b8b52add00bcfdffa548fba549a9f2ba569c40bb3536a60a Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 13 Dec 2020 21:28:49 +0000 Subject: [PATCH] Accepting request 855615 from home:mcepl:branches:devel:tools:scm - We don't need to break Python 2.7 OBS-URL: https://build.opensuse.org/request/show/855615 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-geventhttpclient?expand=0&rev=11 --- python-geventhttpclient.changes | 5 +++++ python-geventhttpclient.spec | 3 +++ remove_mock.patch | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/python-geventhttpclient.changes b/python-geventhttpclient.changes index 9e4b82a..a067ef7 100644 --- a/python-geventhttpclient.changes +++ b/python-geventhttpclient.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Dec 13 20:26:16 UTC 2020 - Matej Cepl + +- We don't need to break Python 2.7 + ------------------------------------------------------------------- Fri Dec 11 23:08:43 UTC 2020 - Matej Cepl diff --git a/python-geventhttpclient.spec b/python-geventhttpclient.spec index b65c997..45d3484 100644 --- a/python-geventhttpclient.spec +++ b/python-geventhttpclient.spec @@ -35,6 +35,9 @@ BuildRequires: %{python_module gevent} BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: %{python_module six} +%ifpython2 +BuildRequires: %{python_module mock} +%endif BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-certifi diff --git a/remove_mock.patch b/remove_mock.patch index 0bd7a87..e0e5604 100644 --- a/remove_mock.patch +++ b/remove_mock.patch @@ -1,13 +1,16 @@ --- a/src/geventhttpclient/tests/test_ssl.py +++ b/src/geventhttpclient/tests/test_ssl.py -@@ -1,5 +1,4 @@ +@@ -1,5 +1,7 @@ -import mock -from mock import patch, Mock -+import unittest.mock as mock ++try: ++ import unittest.mock as mock ++except ImportError: ++ import mock import dpkt.ssl import six -@@ -117,7 +116,7 @@ def _get_sni_sent_from_client(**addition +@@ -117,7 +119,7 @@ def _get_sni_sent_from_client(**addition ('127.0.0.1', server_port) ) with mock.patch(