From 1ec981d04fec456eb55b91bf0340080f8ee9ef46 Mon Sep 17 00:00:00 2001 From: Thomas Hahn Date: Fri, 14 Nov 2025 08:09:31 -0500 Subject: [PATCH] Allow PyObject* as return types in functions --- src/tools/clair-c2py/worker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/clair-c2py/worker.cpp b/src/tools/clair-c2py/worker.cpp index fe545b3..954e1d2 100644 --- a/src/tools/clair-c2py/worker.cpp +++ b/src/tools/clair-c2py/worker.cpp @@ -68,7 +68,7 @@ bool worker_t::check_convertibility(clang::FunctionDecl const *f, bool test_retu } if (test_return_type) { auto ty = f->getReturnType(); - if (ty->isPointerType()) { + if (ty->isPointerType() and (ty->getPointeeType().getAsString() != "PyObject")) { if (emit_error) clu::emit_error(f, "c2py: Can not convert a raw C++ pointer to python"); ok = false; } else if ((not ty->isVoidType()) and (not clu::satisfy_concept(ty, this->IsConvertibleC2Py, this->ci))