mirror of
https://github.com/pybind/pybind11.git
synced 2025-03-01 06:12:47 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
bca73e3520
@ -1382,7 +1382,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void advance() {
|
void advance() {
|
||||||
value = reinterpret_steal<object>(PyIter_Next(m_ptr));
|
value = reinterpret_steal<object>(PyIter_Next(m_ptr));
|
||||||
if (PyErr_Occurred()) {
|
if (value.ptr() == nullptr && PyErr_Occurred()) {
|
||||||
throw error_already_set();
|
throw error_already_set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1809,16 +1809,16 @@ public:
|
|||||||
|
|
||||||
explicit capsule(const void *value,
|
explicit capsule(const void *value,
|
||||||
const char *name = nullptr,
|
const char *name = nullptr,
|
||||||
void (*destructor)(PyObject *) = nullptr)
|
PyCapsule_Destructor destructor = nullptr)
|
||||||
: object(PyCapsule_New(const_cast<void *>(value), name, destructor), stolen_t{}) {
|
: object(PyCapsule_New(const_cast<void *>(value), name, destructor), stolen_t{}) {
|
||||||
if (!m_ptr) {
|
if (!m_ptr) {
|
||||||
throw error_already_set();
|
throw error_already_set();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PYBIND11_DEPRECATED("Please pass a destructor that takes a void pointer as input")
|
PYBIND11_DEPRECATED("Please use the ctor with value, name, destructor args")
|
||||||
capsule(const void *value, void (*destruct)(PyObject *))
|
capsule(const void *value, PyCapsule_Destructor destructor)
|
||||||
: object(PyCapsule_New(const_cast<void *>(value), nullptr, destruct), stolen_t{}) {
|
: object(PyCapsule_New(const_cast<void *>(value), nullptr, destructor), stolen_t{}) {
|
||||||
if (!m_ptr) {
|
if (!m_ptr) {
|
||||||
throw error_already_set();
|
throw error_already_set();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user