Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-07-13 08:44:42

The best way would be an exception registration mechanism that allows each
module to register translations between C++ exception types and
corresponding Python exceptions. There are a few technical problems,
however. One is that, as far as I can tell from Python documentation,
exception objects are required to be instances of Python classes.
Unfortunately, it is a long-standing problem that there's no way to build a
new Python class from an extension module, AFAIK. Somebody who's got a stake
in solving this problem could do it, I'm sure... ;-)


----- Original Message -----
From: "Chris Emerson" <chris_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, July 13, 2001 7:59 AM
Subject: [boost] Boost.Python and exceptions

> I've wrapped a C++ library which throws exceptions which I'd like to be
> visible from Python more sensibly. The exceptions don't derive from
> std::exception.
> It looks like all exception handling is done in
> boost::python::handle_exception(). Perhaps module_builder could have an
> optional function pointer argument to add (or replace) handle_exception()?
> Or is there a better way of accomplishing this?
> Thanks,
> Chris
> Info: Unsubscribe:
> Your use of Yahoo! Groups is subject to

Boost list run by bdawes at, gregod at, cpdaniel at, john at