From ad53aa82f9bc1ff6779010a27c944f6a30ce8a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Fri, 28 Aug 2020 01:00:00 +0000 Subject: [PATCH] pybind11: move to PYBIND11_MODULE to get rid of deprecation warnings --- userland/libs/pybind11/class_test.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/userland/libs/pybind11/class_test.cpp b/userland/libs/pybind11/class_test.cpp index 0f86c19..9e10bff 100644 --- a/userland/libs/pybind11/class_test.cpp +++ b/userland/libs/pybind11/class_test.cpp @@ -18,8 +18,8 @@ struct ClassTestDerived : ClassTest { namespace py = pybind11; -PYBIND11_PLUGIN(class_test) { - py::module m("my_module", "pybind11 example plugin"); +PYBIND11_MODULE(class_test, m) { + m.doc() = "pybind11 example plugin"; py::class_(m, "ClassTest") .def(py::init()) .def("setName", &ClassTest::setName) @@ -29,5 +29,4 @@ PYBIND11_PLUGIN(class_test) { .def(py::init()) .def("getName2", &ClassTestDerived::getName2) .def_readwrite("name", &ClassTestDerived::name); - return m.ptr(); }