]> git.alsa-project.org Git - alsa-python.git/commitdiff
alsaseq: Fix type check in set_time()
authorErnestas Kulik <ernestas@baltic.engineering>
Sun, 6 Apr 2025 14:00:04 +0000 (17:00 +0300)
committerJaroslav Kysela <perex@perex.cz>
Mon, 14 Apr 2025 08:07:30 +0000 (10:07 +0200)
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 <ernestas@baltic.engineering>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
pyalsa/alsaseq.c

index 98a503098601b99927e6db85dfd9098da54713c2..3cbeb32b77322ca4188489d63f7ef26f6d34e378 100644 (file)
@@ -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,