MCPcopy Create free account
hub / github.com/mhammond/pywin32 / Python_do_callback

Function Python_do_callback

Pythonwin/win32uimodule.cpp:715–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713// callbacks!
714static PyObject *pCallbackCaller = NULL;
715PyObject *Python_do_callback(PyObject *themeth, PyObject *thearglst)
716{
717 PyObject *result;
718 if (pCallbackCaller) {
719 PyObject *newarglst = Py_BuildValue("(OO)",themeth,thearglst);
720 result = gui_call_object( pCallbackCaller, newarglst );
721 DODECREF(newarglst);
722 } else {
723 // Only ref to 'themeth' may be map - and if the message hook
724 // updates the map (ie, removes the function), things get
725 // a little pear-shaped - as witnessed in bug 1489690.
726 Py_XINCREF(themeth);
727 result = gui_call_object( themeth, thearglst );
728 Py_XDECREF(themeth);
729 }
730 DODECREF(thearglst);
731 if (result==NULL) {
732 TRACE("Python_do_callback: callback failed with exception\n");
733 gui_print_error();
734 }
735 return result;
736}
737
738// Copied from PyRecord.cpp, should move into pywintypes.h
739#if (PY_VERSION_HEX < 0x03000000)

Callers 2

Python_do_int_callbackFunction · 0.85
Python_OnNotifyFunction · 0.85

Calls 2

gui_call_objectFunction · 0.85
gui_print_errorFunction · 0.85

Tested by

no test coverage detected