From 04358b02ed7934b271aa3e26ce44ab255dfa9197 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Thu, 1 Oct 2015 16:45:28 +0200 Subject: [PATCH] Always record the __module__ in newly created Python types --- include/pybind/pybind.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index d7ce2c99a..156e5705c 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -521,8 +521,7 @@ public: m_ptr = (PyObject *) type; /* Needed by pydoc */ - if (((module &) scope).check()) - attr("__module__") = scope_name; + attr("__module__") = scope_name; auto &type_info = detail::get_internals().registered_types[tinfo]; type_info.type = (PyTypeObject *) m_ptr;