From be26b2a7dc5e596449ee1c59285c7339622fc5ab Mon Sep 17 00:00:00 2001 From: Ernestas Kulik Date: Sun, 6 Apr 2025 17:00:04 +0300 Subject: [PATCH] alsaseq: Fix type check in set_time() SeqEvent_set_time() has fallen victim to the inverted get_long1() return value here, erroring out when called with actual integers. Closes: https://github.com/alsa-project/alsa-python/pull/17 Signed-off-by: Ernestas Kulik Signed-off-by: Jaroslav Kysela --- pyalsa/alsaseq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyalsa/alsaseq.c b/pyalsa/alsaseq.c index 98a5030..3cbeb32 100644 --- a/pyalsa/alsaseq.c +++ b/pyalsa/alsaseq.c @@ -847,7 +847,7 @@ SeqEvent_set_time(SeqEventObject *self, PyObject *val) { long lval = 0; const int is_float = PyFloat_Check(val); - const int is_int = is_float ? 0 : get_long1(val, &lval); + const int is_int = is_float ? 0 : !get_long1(val, &lval); if (!(is_int || is_float)) { PyErr_Format(PyExc_TypeError, -- 2.47.1