mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 05:47:13 +02:00
32 lines
1.2 KiB
Diff
32 lines
1.2 KiB
Diff
From 551e8c9130d96a1b8daa0568befe397a089005d1 Mon Sep 17 00:00:00 2001
|
|
From: Aleksei Bavshin <alebastr@fedoraproject.org>
|
|
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
|
|
|