[Python-checkins] closes bpo-43011: Fix DeprecationWarnings in test_ctypes (GH-24305)

miss-islington webhook-mailer at python.org
Sat Jan 23 11:56:11 EST 2021


https://github.com/python/cpython/commit/00e24cdca422f792b80016287562b6b3bccab239
commit: 00e24cdca422f792b80016287562b6b3bccab239
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-01-23T08:56:08-08:00
summary:

closes bpo-43011: Fix DeprecationWarnings in test_ctypes (GH-24305)

(cherry picked from commit f7fa64f0e87edc61d990ed51b4da722906a10928)

Co-authored-by: Zackery Spytz <zspytz at gmail.com>

files:
M Lib/ctypes/test/test_parameters.py

diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py
index 531894fdec838..38af7ac13d756 100644
--- a/Lib/ctypes/test/test_parameters.py
+++ b/Lib/ctypes/test/test_parameters.py
@@ -240,8 +240,8 @@ def test_parameter_repr(self):
         self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>")
         self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>")
         self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$")
-        self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$")
-        self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$")
+        self.assertRegex(repr(c_char_p.from_param(b'hihi')), r"^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$")
+        self.assertRegex(repr(c_wchar_p.from_param('hihi')), r"^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$")
         self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$")
 
 ################################################################



More information about the Python-checkins mailing list