From 61ad86dba0882896317538ac01f60be87d94332c Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 15 Mar 2019 09:31:59 -0500 Subject: [PATCH] Updating error raised and a sylte change. --- openmc/capi/plot.py | 4 ++-- src/plot.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/openmc/capi/plot.py b/openmc/capi/plot.py index ac4a457b5..78fcef912 100644 --- a/openmc/capi/plot.py +++ b/openmc/capi/plot.py @@ -31,7 +31,7 @@ class _Position(Structure): elif idx == 2: return self.z else: - raise ValueError("{} index is invalid for _Position".format(idx)) + raise IndexError("{} index is invalid for _Position".format(key)) def __setitem__(self, idx, val): if idx == 0: @@ -41,7 +41,7 @@ class _Position(Structure): elif idx == 2: self.z = val else: - raise ValueError("{} index is invalid for _Position".format(idx)) + raise IndexError("{} index is invalid for _Position".format(idx)) def __repr__(self): return "({}, {}, {})".format(self.x, self.y, self.z) diff --git a/src/plot.cpp b/src/plot.cpp index 53f6956c2..18103a141 100644 --- a/src/plot.cpp +++ b/src/plot.cpp @@ -954,7 +954,8 @@ RGBColor random_color() { return {int(prn()*255), int(prn()*255), int(prn()*255)}; } -extern "C" int openmc_id_map(const void* plot, int32_t* data_out) { +extern "C" int openmc_id_map(const void* plot, int32_t* data_out) +{ auto plt = reinterpret_cast(plot); if (!plt) {