diff --git a/RBTools-4.0-Fix-Python-3.12-compatibility.patch b/RBTools-4.0-Fix-Python-3.12-compatibility.patch new file mode 100644 index 0000000..8778095 --- /dev/null +++ b/RBTools-4.0-Fix-Python-3.12-compatibility.patch @@ -0,0 +1,31 @@ +From 551e8c9130d96a1b8daa0568befe397a089005d1 Mon Sep 17 00:00:00 2001 +From: Aleksei Bavshin +Date: Thu, 5 Oct 2023 08:27:49 -0700 +Subject: [PATCH] Fix Python 3.12 compatibility + +`assertRaisesRegexp` was deprecated in Python 3.2 and removed in 3.12. +--- + rbtools/testing/testcase.py | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/rbtools/testing/testcase.py b/rbtools/testing/testcase.py +index 4a36501..1b9cdf4 100644 +--- a/rbtools/testing/testcase.py ++++ b/rbtools/testing/testcase.py +@@ -292,11 +292,8 @@ class TestCase(unittest.TestCase): + The assertion failure, if the exception and message isn't + raised. + """ +- # This explicitly uses the old name, as opposed to assertRaisesRegex, +- # because we still need Python 2.7 support. Once we move to Python 3, +- # we can fix this. +- return self.assertRaisesRegexp(expected_exception, +- re.escape(expected_message)) ++ return self.assertRaisesRegex(expected_exception, ++ re.escape(expected_message)) + + def create_rbclient(self): + """Return a RBClient for testing. +-- +2.41.0 + diff --git a/RBTools.spec b/RBTools.spec index 1db0ca0..6bc7165 100644 --- a/RBTools.spec +++ b/RBTools.spec @@ -1,6 +1,6 @@ Name: RBTools Version: 4.0 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Tools for use with ReviewBoard License: MIT @@ -8,6 +8,9 @@ URL: https://www.reviewboard.org/downloads/rbtools/ Source: https://github.com/reviewboard/%{name}/archive/release-%{version}/%{name}-%{version}.tar.gz Patch: build_release.patch +# Upstream is aware, but keeps using the deprecated method for +# Python 2.7 compatibility, see commit fb453a9 +Patch: RBTools-4.0-Fix-Python-3.12-compatibility.patch BuildArch: noarch @@ -30,7 +33,7 @@ code-review server. %prep -%autosetup -n rbtools-release-%{version} +%autosetup -p1 -n rbtools-release-%{version} %generate_buildrequires %pyproject_buildrequires @@ -76,6 +79,10 @@ cp rbtools/commands/conf/_rbt-zsh-completion \ %changelog +* Thu Oct 05 2023 Aleksei Bavshin - 4.0-6 +- Fix Python 3.12 compatibility (rhbz#2219926) +- Verify that the License tag is valid SPDX + * Wed Jul 19 2023 Fedora Release Engineering - 4.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild