aboutsummaryrefslogtreecommitdiffstats
path: root/common/pybindings.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2020-07-24 11:03:08 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2020-07-24 11:03:08 +0200
commit597f4a1495a7e6b4bd5eed426cd2808d77280fd9 (patch)
tree017c376d8fbd1fa48ce0c00f757d31a2e504d06d /common/pybindings.cc
parent598ef014e686a1c03821b6728782dbf98f8ff038 (diff)
downloadnextpnr-597f4a1495a7e6b4bd5eed426cd2808d77280fd9.tar.gz
nextpnr-597f4a1495a7e6b4bd5eed426cd2808d77280fd9.tar.bz2
nextpnr-597f4a1495a7e6b4bd5eed426cd2808d77280fd9.zip
exception translation
Diffstat (limited to 'common/pybindings.cc')
-rw-r--r--common/pybindings.cc8
1 files changed, 1 insertions, 7 deletions
diff --git a/common/pybindings.cc b/common/pybindings.cc
index 3f288e78..4711f10c 100644
--- a/common/pybindings.cc
+++ b/common/pybindings.cc
@@ -64,12 +64,6 @@ Context *load_design_shim(std::string filename, ArchArgs args)
return d;
}
-void translate_assertfail(const assertion_failure &e)
-{
- // Use the Python 'C' API to set up an exception object
- PyErr_SetString(PyExc_AssertionError, e.what());
-}
-
namespace PythonConversion {
template <> struct string_converter<PortRef &>
{
@@ -92,7 +86,7 @@ template <> struct string_converter<Property>
PYBIND11_MODULE(MODULE_NAME, m)
{
- //register_exception_translator<assertion_failure>(&translate_assertfail);
+ py::register_exception<assertion_failure>(m, "PyExc_AssertionError");
using namespace PythonConversion;