Return NULL on error to throw an exception

This commit is contained in:
Brandon Skari
2016-02-03 10:31:14 -07:00
parent 001770505c
commit 16b844f636

View File

@@ -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;