@@ -1668,6 +1668,7 @@ parse_tuple_and_keywords(PyObject *self, PyObject *args)
16681668
16691669static volatile int x ;
16701670
1671+ #if USE_UNICODE_WCHAR_CACHE
16711672/* Ignore use of deprecated APIs */
16721673_Py_COMP_DIAG_PUSH
16731674_Py_COMP_DIAG_IGNORE_DEPR_DECLS
@@ -1772,6 +1773,8 @@ test_Z_code(PyObject *self, PyObject *Py_UNUSED(ignored))
17721773 Py_DECREF (tuple );
17731774 Py_RETURN_NONE ;
17741775}
1776+ _Py_COMP_DIAG_POP
1777+ #endif /* USE_UNICODE_WCHAR_CACHE */
17751778
17761779static PyObject *
17771780test_widechar (PyObject * self , PyObject * Py_UNUSED (ignored ))
@@ -1824,6 +1827,10 @@ test_widechar(PyObject *self, PyObject *Py_UNUSED(ignored))
18241827 return raiseTestError ("test_widechar" ,
18251828 "PyUnicode_FromWideChar(L\"\\U00110000\", 1) didn't fail" );
18261829
1830+ #if USE_UNICODE_WCHAR_CACHE
1831+ /* Ignore use of deprecated APIs */
1832+ _Py_COMP_DIAG_PUSH
1833+ _Py_COMP_DIAG_IGNORE_DEPR_DECLS
18271834 wide = PyUnicode_FromUnicode (invalid , 1 );
18281835 if (wide == NULL )
18291836 PyErr_Clear ();
@@ -1844,11 +1851,12 @@ test_widechar(PyObject *self, PyObject *Py_UNUSED(ignored))
18441851 return raiseTestError ("test_widechar" ,
18451852 "PyUnicode_Ready() didn't fail" );
18461853 }
1854+ _Py_COMP_DIAG_POP
1855+ #endif /* USE_UNICODE_WCHAR_CACHE */
18471856#endif
18481857
18491858 Py_RETURN_NONE ;
18501859}
1851- _Py_COMP_DIAG_POP
18521860
18531861static PyObject *
18541862unicode_aswidechar (PyObject * self , PyObject * args )
@@ -2024,6 +2032,7 @@ unicode_copycharacters(PyObject *self, PyObject *args)
20242032 return Py_BuildValue ("(Nn)" , to_copy , copied );
20252033}
20262034
2035+ #if USE_UNICODE_WCHAR_CACHE
20272036/* Ignore use of deprecated APIs */
20282037_Py_COMP_DIAG_PUSH
20292038_Py_COMP_DIAG_IGNORE_DEPR_DECLS
@@ -2096,6 +2105,7 @@ unicode_legacy_string(PyObject *self, PyObject *args)
20962105 return u ;
20972106}
20982107_Py_COMP_DIAG_POP
2108+ #endif /* USE_UNICODE_WCHAR_CACHE */
20992109
21002110static PyObject *
21012111getargs_w_star (PyObject * self , PyObject * args )
@@ -5398,8 +5408,10 @@ static PyMethodDef TestMethods[] = {
53985408 {"codec_incrementaldecoder" ,
53995409 (PyCFunction )codec_incrementaldecoder , METH_VARARGS },
54005410 {"test_s_code" , test_s_code , METH_NOARGS },
5411+ #if USE_UNICODE_WCHAR_CACHE
54015412 {"test_u_code" , test_u_code , METH_NOARGS },
54025413 {"test_Z_code" , test_Z_code , METH_NOARGS },
5414+ #endif /* USE_UNICODE_WCHAR_CACHE */
54035415 {"test_widechar" , test_widechar , METH_NOARGS },
54045416 {"unicode_aswidechar" , unicode_aswidechar , METH_VARARGS },
54055417 {"unicode_aswidecharstring" ,unicode_aswidecharstring , METH_VARARGS },
@@ -5408,9 +5420,11 @@ static PyMethodDef TestMethods[] = {
54085420 {"unicode_asutf8andsize" , unicode_asutf8andsize , METH_VARARGS },
54095421 {"unicode_findchar" , unicode_findchar , METH_VARARGS },
54105422 {"unicode_copycharacters" , unicode_copycharacters , METH_VARARGS },
5423+ #if USE_UNICODE_WCHAR_CACHE
54115424 {"unicode_encodedecimal" , unicode_encodedecimal , METH_VARARGS },
54125425 {"unicode_transformdecimaltoascii" , unicode_transformdecimaltoascii , METH_VARARGS },
54135426 {"unicode_legacy_string" , unicode_legacy_string , METH_VARARGS },
5427+ #endif /* USE_UNICODE_WCHAR_CACHE */
54145428 {"_test_thread_state" , test_thread_state , METH_VARARGS },
54155429 {"_pending_threadfunc" , pending_threadfunc , METH_VARARGS },
54165430#ifdef HAVE_GETTIMEOFDAY
0 commit comments