From 335bbfc191f7e2c63cc9e6c532fdfa4e810b627f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Tue, 11 Jun 2024 19:21:53 +0200 Subject: [PATCH] python: make corrade.utility depend on corrade.containers. It got imported in this order for doc generation and probably also in all tests, but when imported alone, the signature of copy() is broken because it references a not-yet-known type. --- src/python/corrade/utility.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/python/corrade/utility.cpp b/src/python/corrade/utility.cpp index 77e1582..f56664c 100644 --- a/src/python/corrade/utility.cpp +++ b/src/python/corrade/utility.cpp @@ -58,6 +58,13 @@ template void algorithmsCopy(py::module_& m) { void utility(py::module_& m) { m.doc() = "Utilities"; + #ifndef CORRADE_BUILD_STATIC + /* Need array views for copy() and others. These are a part of the same + module in the static build, no need to import (also can't import because + there it's _corrade.*) */ + py::module_::import("corrade.containers"); + #endif + algorithmsCopy<1>(m); algorithmsCopy<2>(m); algorithmsCopy<3>(m);