@@ -2077,17 +2077,14 @@ has_deferred_refcount(PyObject *self, PyObject *op)
20772077}
20782078
20792079static PyObject *
2080- dump_executors (PyObject * self , PyObject * Py_UNUSED (ignored ))
2081- {
2082- # ifdef MS_WINDOWS
2083- const char * dirname = "c:\\temp\\py_stats\\" ;
2084- # else
2085- const char * dirname = "/tmp/py_stats/" ;
2086- # endif
2087- char buf [64 ];
2088- sprintf (buf , "%s%s.gv" , dirname , "executor_dump" );
2089- FILE * out = fopen (buf , "w" );
2080+ dump_executors (PyObject * self , PyObject * filepath )
2081+ {
2082+ FILE * out = _Py_fopen_obj (filepath , "wb" );
2083+ if (out == NULL ) {
2084+ return NULL ;
2085+ }
20902086 _PyDumpExecutors (out );
2087+ fclose (out );
20912088 Py_RETURN_NONE ;
20922089}
20932090
@@ -2189,7 +2186,7 @@ static PyMethodDef module_functions[] = {
21892186 {"get_static_builtin_types" , get_static_builtin_types , METH_NOARGS },
21902187 {"identify_type_slot_wrappers" , identify_type_slot_wrappers , METH_NOARGS },
21912188 {"has_deferred_refcount" , has_deferred_refcount , METH_O },
2192- {"dump_executors" , dump_executors , METH_NOARGS },
2189+ {"dump_executors" , dump_executors , METH_O },
21932190 {NULL , NULL } /* sentinel */
21942191};
21952192
0 commit comments