mirror of
https://github.com/boostorg/python.git
synced 2026-01-19 04:22:16 +00:00
Avoid setting __doc__ on instance methods
This commit is contained in:
committed by
Stefan Seefeld
parent
c76d67ef3f
commit
301256cf1e
@@ -586,6 +586,13 @@ BOOST_PYTHON_DECL void add_to_namespace(
|
||||
|
||||
BOOST_PYTHON_DECL object const& add_doc(object const& attribute, char const* doc)
|
||||
{
|
||||
#if PY_VERSION_HEX >= 0x03000000
|
||||
if (PyInstanceMethod_Check(attribute.ptr())) {
|
||||
#else
|
||||
if (PyMethod_Check(attribute.ptr())) {
|
||||
#endif
|
||||
return attribute;
|
||||
}
|
||||
return function::add_doc(attribute, doc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user