2
0
mirror of https://github.com/boostorg/python.git synced 2026-02-01 20:52:13 +00:00

use the new "no-rethrow" way of handling exceptions.

[SVN r11691]
This commit is contained in:
Dave Abrahams
2001-11-14 20:07:38 +00:00
parent 5bec0d2d98
commit 7d6ff83760
2 changed files with 48 additions and 7 deletions

View File

@@ -10,8 +10,9 @@
// 04 Mar 01 Use PyObject_INIT() instead of trying to hand-initialize (David Abrahams)
#include <boost/python/detail/extension_class.hpp>
#include <cstring>
#include <boost/utility.hpp>
#include <boost/bind.hpp>
#include <cstring>
namespace boost { namespace python {
namespace detail {
@@ -484,16 +485,19 @@ void operator_dispatcher_dealloc(PyObject* self)
int operator_dispatcher_coerce(PyObject** l, PyObject** r)
{
Py_INCREF(*l);
try
PyObject* new_r = handle_exception(
bind(operator_dispatcher::create,
ref(*r, ref::increment_count),
ref()));
if (new_r)
{
*r = operator_dispatcher::create(ref(*r, ref::increment_count), ref());
*r = new_r;
return 0;
}
catch(...)
else
{
handle_exception();
return -1;
}
return 0;
}