From 16b844f636be41db1ebd321ffe5e7eb56f7ed40e Mon Sep 17 00:00:00 2001 From: Brandon Skari Date: Wed, 3 Feb 2016 10:31:14 -0700 Subject: [PATCH] Return NULL on error to throw an exception --- src/python/_rpitxmodule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python/_rpitxmodule.c b/src/python/_rpitxmodule.c index c946587..b1e9fd8 100644 --- a/src/python/_rpitxmodule.c +++ b/src/python/_rpitxmodule.c @@ -109,7 +109,7 @@ _rpitx_broadcast_fm(PyObject* self, PyObject* args) { assert(sizeof(address) == sizeof(sampleBase)); if (!PyArg_ParseTuple(args, "lif", &address, &sampleLength, &frequency)) { PyErr_SetString(rpitxError, "Invalid arguments"); - Py_RETURN_NONE; + return NULL; } sampleBase = ((void*)address); @@ -133,7 +133,7 @@ _rpitx_broadcast_fm(PyObject* self, PyObject* args) { sf_strerror(sndFile)); message[COUNT_OF(message) - 1] = '\0'; PyErr_SetString(rpitxError, message); - Py_RETURN_NONE; + return NULL; } bitRate = sfInfo.samplerate;