@@ -381,6 +381,19 @@ static PyTypeObject _HashInheritanceTester_Type = {
381381 PyType_GenericNew , /* tp_new */
382382};
383383
384+ static PyObject *
385+ pycompilestring (PyObject * self , PyObject * obj ) {
386+ if (PyBytes_CheckExact (obj ) == 0 ) {
387+ PyErr_SetString (PyExc_ValueError , "Argument must be a bytes object" );
388+ return NULL ;
389+ }
390+ const char * the_string = PyBytes_AsString (obj );
391+ if (the_string == NULL ) {
392+ return NULL ;
393+ }
394+ return Py_CompileString (the_string , "blech" , Py_file_input );
395+ }
396+
384397static PyObject *
385398test_lazy_hash_inheritance (PyObject * self , PyObject * Py_UNUSED (ignored ))
386399{
@@ -6070,6 +6083,7 @@ static PyMethodDef TestMethods[] = {
60706083 {"return_null_without_error" , return_null_without_error , METH_NOARGS },
60716084 {"return_result_with_error" , return_result_with_error , METH_NOARGS },
60726085 {"getitem_with_error" , getitem_with_error , METH_VARARGS },
6086+ {"Py_CompileString" , pycompilestring , METH_O },
60736087 {"PyTime_FromSeconds" , test_pytime_fromseconds , METH_VARARGS },
60746088 {"PyTime_FromSecondsObject" , test_pytime_fromsecondsobject , METH_VARARGS },
60756089 {"PyTime_AsSecondsDouble" , test_pytime_assecondsdouble , METH_VARARGS },
0 commit comments