2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-27 07:02:15 +00:00

new class_<> objects are always added to the current scope

[SVN r14964]
This commit is contained in:
Dave Abrahams
2002-08-19 20:14:33 +00:00
parent 3c5df28101
commit a5d53d1ac8
10 changed files with 75 additions and 70 deletions

View File

@@ -42,23 +42,6 @@ void module_base::add(type_handle const& x)
this->setattr_doc(x->tp_name, python::object(x), 0);
}
void module_base::add_class(type_handle const& class_obj)
{
this->add(class_obj);
handle<> module_name(
PyObject_GetAttrString(
m_module.get(), const_cast<char*>("__name__"))
);
int status = PyObject_SetAttrString(
python::upcast<PyObject>(class_obj.get())
, const_cast<char*>("__module__"), module_name.get());
if (status == -1)
throw_error_already_set();
}
PyMethodDef module_base::initial_methods[] = { { 0, 0, 0, 0 } };
namespace