From 8ff10e849db07533da7489876c6792ccafeb9d90 Mon Sep 17 00:00:00 2001 From: tzing_t Date: Mon, 18 Nov 2024 12:26:23 +0000 Subject: [PATCH] support python3.11 fix build error in test --- python-pycurl.spec | 6 +++++- support_python3.11.patch | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 support_python3.11.patch diff --git a/python-pycurl.spec b/python-pycurl.spec index 15f6122..1cf259a 100644 --- a/python-pycurl.spec +++ b/python-pycurl.spec @@ -7,13 +7,14 @@ Name: python-%{srcname} Version: 7.44.1 -Release: 3 +Release: 4 Summary: A Python interface to libcurl License: LGPLv2+ or MIT URL: http://pycurl.sourceforge.net/ Source0: %{pypi_source} # drop link-time vs. run-time TLS backend check (#1446850) +Patch01: support_python3.11.patch BuildRequires: gcc libcurl-devel openssl-devel vsftpd @@ -100,6 +101,9 @@ rm -fv tests/fake-curl/libcurl/*.so %{python3_sitearch}/pycurl-%{version}-*.egg-info %changelog +* Mon Nov 18 2024 tzing_t - 7.44.1-4 +- support python3.11 + * Wed Oct 26 2022 zhangruifang - 7.44.1-3 - Rebuild for next release diff --git a/support_python3.11.patch b/support_python3.11.patch new file mode 100644 index 0000000..2bd7dc5 --- /dev/null +++ b/support_python3.11.patch @@ -0,0 +1,25 @@ +diff --git a/tests/error_test.py b/tests/error_test.py +index 01d0ac5..d4c5218 100644 +--- a/tests/error_test.py ++++ b/tests/error_test.py +@@ -29,7 +29,7 @@ class ErrorTest(unittest.TestCase): + err, msg = exc.args + self.assertEqual(pycurl.E_URL_MALFORMAT, err) + # possibly fragile +- self.assertEqual('No URL set!', msg) ++ self.assertEqual('No URL set', msg) + else: + self.fail('Expected pycurl.error to be raised') + +@@ -43,9 +43,9 @@ class ErrorTest(unittest.TestCase): + self.curl.perform() + except pycurl.error: + # might be fragile +- self.assertEqual('No URL set!', self.curl.errstr()) ++ self.assertEqual('No URL set', self.curl.errstr()) + # repeated checks do not clear value +- self.assertEqual('No URL set!', self.curl.errstr()) ++ self.assertEqual('No URL set', self.curl.errstr()) + # check the type - on all python versions + self.assertEqual(str, type(self.curl.errstr())) + else: -- Gitee