From e63638ac05d005abb65444159b6c58a16e42a213 Mon Sep 17 00:00:00 2001 From: Mate Soos Date: Mon, 3 Oct 2022 19:56:27 +0200 Subject: [PATCH] Fixing up error messages --- python/src/pyapproxmc.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/src/pyapproxmc.cpp b/python/src/pyapproxmc.cpp index e377a79..7c18f88 100644 --- a/python/src/pyapproxmc.cpp +++ b/python/src/pyapproxmc.cpp @@ -85,12 +85,12 @@ static void setup_counter(Counter *self, PyObject *args, PyObject *kwds) PyErr_SetString(PyExc_ValueError, "verbosity must be at least 0"); return; } - if (self->epsilon <= 0) { - PyErr_SetString(PyExc_ValueError, "epsilon must be greater than 0"); + if (self->epsilon <= 0 || self->epsilon >= 1) { + PyErr_SetString(PyExc_ValueError, "epsilon must be greater or equal to 0, and less than 1"); return; } if (self->delta < 0 || self->delta >= 1) { - PyErr_SetString(PyExc_ValueError, "delta must be greater than or equal to 0 and less than 1"); + PyErr_SetString(PyExc_ValueError, "delta must be greater or equal to 0, and less than 1"); return; }