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) {