Skip to content

Commit

Permalink
fix for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed Sep 1, 2022
1 parent 3fb41da commit 1f11a01
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int>(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;
Expand Down
6 changes: 1 addition & 5 deletions tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == {}
Expand Down Expand Up @@ -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 == {}
Expand Down

0 comments on commit 1f11a01

Please sign in to comment.