Add missing handle_type_name<module_>.

Discovered via manual inspection by @sizmailov:

https://github.com/pybind/pybind11/pull/4888#issuecomment-1774023960

NOTE: This is actually a bug fix, in its own right.
This commit is contained in:
Ralf W. Grosse-Kunstleve 2023-10-22 07:32:12 -07:00
parent 3c20944355
commit 74817b7f9f

View File

@ -1318,6 +1318,15 @@ public:
} }
}; };
PYBIND11_NAMESPACE_BEGIN(detail)
template <>
struct handle_type_name<module_> {
static constexpr auto name = const_name("module");
};
PYBIND11_NAMESPACE_END(detail)
// When inside a namespace (or anywhere as long as it's not the first item on a line), // When inside a namespace (or anywhere as long as it's not the first item on a line),
// C++20 allows "module" to be used. This is provided for backward compatibility, and for // C++20 allows "module" to be used. This is provided for backward compatibility, and for
// simplicity, if someone wants to use py::module for example, that is perfectly safe. // simplicity, if someone wants to use py::module for example, that is perfectly safe.