summaryrefslogtreecommitdiffstats
path: root/Lib/test/clinic.test
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2020-06-30 06:03:15 (GMT)
committerGitHub <noreply@github.com>2020-06-30 06:03:15 (GMT)
commit349f76c6aace5a4a2b57f6b442a532faf0027d6b (patch)
treec9d8fe1e3062e51e65cd7b2a763822908cb7a1cb /Lib/test/clinic.test
parentb3332660adb02babb7e66e45310c66dc9a9a94da (diff)
downloadcpython-349f76c6aace5a4a2b57f6b442a532faf0027d6b.zip
cpython-349f76c6aace5a4a2b57f6b442a532faf0027d6b.tar.gz
cpython-349f76c6aace5a4a2b57f6b442a532faf0027d6b.tar.bz2
bpo-36346: Prepare for removing the legacy Unicode C API (AC only). (GH-21223)
Diffstat (limited to 'Lib/test/clinic.test')
-rw-r--r--Lib/test/clinic.test19
1 files changed, 16 insertions, 3 deletions
diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test
index f2be613..07e1382 100644
--- a/Lib/test/clinic.test
+++ b/Lib/test/clinic.test
@@ -1813,13 +1813,26 @@ test_Py_UNICODE_converter(PyObject *module, PyObject *const *args, Py_ssize_t na
const Py_UNICODE *e;
Py_ssize_clean_t e_length;
- if (!_PyArg_ParseStack(args, nargs, "uuZu#Z#:test_Py_UNICODE_converter",
- &a, &b, &c, &d, &d_length, &e, &e_length)) {
+ if (!_PyArg_ParseStack(args, nargs, "O&O&O&u#Z#:test_Py_UNICODE_converter",
+ _PyUnicode_WideCharString_Converter, &a, _PyUnicode_WideCharString_Converter, &b, _PyUnicode_WideCharString_Opt_Converter, &c, &d, &d_length, &e, &e_length)) {
goto exit;
}
return_value = test_Py_UNICODE_converter_impl(module, a, b, c, d, d_length, e, e_length);
exit:
+ /* Cleanup for a */
+ #if !USE_UNICODE_WCHAR_CACHE
+ PyMem_Free((void *)a);
+ #endif /* USE_UNICODE_WCHAR_CACHE */
+ /* Cleanup for b */
+ #if !USE_UNICODE_WCHAR_CACHE
+ PyMem_Free((void *)b);
+ #endif /* USE_UNICODE_WCHAR_CACHE */
+ /* Cleanup for c */
+ #if !USE_UNICODE_WCHAR_CACHE
+ PyMem_Free((void *)c);
+ #endif /* USE_UNICODE_WCHAR_CACHE */
+
return return_value;
}
@@ -1830,7 +1843,7 @@ test_Py_UNICODE_converter_impl(PyObject *module, const Py_UNICODE *a,
Py_ssize_clean_t d_length,
const Py_UNICODE *e,
Py_ssize_clean_t e_length)
-/*[clinic end generated code: output=dd0a09a1b772e57b input=064a3b68ad7f04b0]*/
+/*[clinic end generated code: output=ef45e982fedf0b3d input=064a3b68ad7f04b0]*/
/*[clinic input]