diff --git a/src/core.cpp b/src/core.cpp index 57b1a7f..ecb019a 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -262,7 +262,7 @@ inline std::ostream& repr(std::ostream& os, const HepMC3::GenEvent& x) { inline int gencrosssection_validate_index(GenCrossSection& cs, py::object obj) { auto idx = py::cast(obj); - const auto size = cs.event() ? std::max(cs.event()->weights().size(), 1ul) : 1ul; + const auto size = cs.event() ? (std::max)(cs.event()->weights().size(), 1ul) : 1ul; if (idx < 0) idx += size; if (idx < 0 || idx >= size) throw py::index_error(); return idx; diff --git a/tests/test_basic.py b/tests/test_basic.py index edb4c6c..281dc8c 100644 --- a/tests/test_basic.py +++ b/tests/test_basic.py @@ -140,7 +140,7 @@ def test_GenCrossSection(): cs.xsec_err("baz") -def test_attributes_0(): +def test_attributes_1(): ri = hep.GenRunInfo() att = ri.attributes assert att == {} @@ -177,10 +177,6 @@ def test_attributes_0(): assert len(att) == 0 -def test_attributes_1(): - pass - - def test_attributes_2(evt): att = evt.attributes assert att == {}