bpo-36346: Emit DeprecationWarning for PyArg_Parse() with 'u' or 'Z'. (GH-20927)
Emit DeprecationWarning when PyArg_Parse*() is called with 'u', 'Z' format.
See PEP 623.
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index df8f2c9..2626be6 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -2368,12 +2368,14 @@ def test_resize(self):
text = 'a' * length + 'b'
# fill wstr internal field
- abc = getargs_u(text)
+ with self.assertWarns(DeprecationWarning):
+ abc = getargs_u(text)
self.assertEqual(abc, text)
# resize text: wstr field must be cleared and then recomputed
text += 'c'
- abcdef = getargs_u(text)
+ with self.assertWarns(DeprecationWarning):
+ abcdef = getargs_u(text)
self.assertNotEqual(abc, abcdef)
self.assertEqual(abcdef, text)