mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-23 13:45:10 +00:00
Merge branch 'pybind:master' into master
This commit is contained in:
commit
d9ece32920
@ -100,7 +100,7 @@ private:
|
|||||||
|
|
||||||
if (size > remainder) {
|
if (size > remainder) {
|
||||||
str line(pbase(), size - remainder);
|
str line(pbase(), size - remainder);
|
||||||
pywrite(line);
|
pywrite(std::move(line));
|
||||||
pyflush();
|
pyflush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1581,6 +1581,8 @@ public:
|
|||||||
|
|
||||||
capsule(const void *value, void (*destructor)(void *)) {
|
capsule(const void *value, void (*destructor)(void *)) {
|
||||||
m_ptr = PyCapsule_New(const_cast<void *>(value), nullptr, [](PyObject *o) {
|
m_ptr = PyCapsule_New(const_cast<void *>(value), nullptr, [](PyObject *o) {
|
||||||
|
// guard if destructor called while err indicator is set
|
||||||
|
error_scope error_guard;
|
||||||
auto destructor = reinterpret_cast<void (*)(void *)>(PyCapsule_GetContext(o));
|
auto destructor = reinterpret_cast<void (*)(void *)>(PyCapsule_GetContext(o));
|
||||||
if (destructor == nullptr) {
|
if (destructor == nullptr) {
|
||||||
if (PyErr_Occurred()) {
|
if (PyErr_Occurred()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user