[Lldb-commits] [lldb] [lldb][api-test] Add API test for SBCommandInterpreter::CommandOverrideCallback (PR #94518)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 7 14:02:40 PDT 2024


================
@@ -476,6 +475,23 @@ template <> bool SetNumberFromPyObject<double>(double &number, PyObject *obj) {
   $1 = $1 || PyCallable_Check(reinterpret_cast<PyObject *>($input));
 }
 
+%typemap(in) (lldb::CommandOverrideCallback callback, void *baton) {
+  if (!($input == Py_None ||
+        PyCallable_Check(reinterpret_cast<PyObject *>($input)))) {
+    PyErr_SetString(PyExc_TypeError, "Need a callable object or None!");
+    SWIG_fail;
+  }
+
+  // Don't lose the callback reference
----------------
JDevlieghere wrote:

Nit: missing period. 

https://github.com/llvm/llvm-project/pull/94518


More information about the lldb-commits mailing list