@@ -226,6 +226,18 @@ pycompilestring(PyObject* self, PyObject *obj) {
226226 return Py_CompileString (the_string , "<string>" , Py_file_input );
227227}
228228
229+ static PyObject *
230+ pycompilestringexflags (PyObject * self , PyObject * args ) {
231+ const char * the_string , * filename ;
232+ int start , flags ;
233+ if (!PyArg_ParseTuple (args , "ysii" , & the_string , & filename , & start , & flags )) {
234+ return NULL ;
235+ }
236+ PyCompilerFlags cf = _PyCompilerFlags_INIT ;
237+ cf .cf_flags = flags ;
238+ return Py_CompileStringExFlags (the_string , filename , start , & cf , -1 );
239+ }
240+
229241static PyObject *
230242test_lazy_hash_inheritance (PyObject * self , PyObject * Py_UNUSED (ignored ))
231243{
@@ -2620,6 +2632,7 @@ static PyMethodDef TestMethods[] = {
26202632 {"return_result_with_error" , return_result_with_error , METH_NOARGS },
26212633 {"getitem_with_error" , getitem_with_error , METH_VARARGS },
26222634 {"Py_CompileString" , pycompilestring , METH_O },
2635+ {"Py_CompileStringExFlags" , pycompilestringexflags , METH_VARARGS },
26232636 {"raise_SIGINT_then_send_None" , raise_SIGINT_then_send_None , METH_VARARGS },
26242637 {"stack_pointer" , stack_pointer , METH_NOARGS },
26252638#ifdef W_STOPCODE
0 commit comments