1387 static PyObject *
1388 pa_get_default_input_device(PyObject *self, PyObject *args)
1389 {
1390 PaDeviceIndex index;
1391
1392 if (!PyArg_ParseTuple(args, ""))
when PyArg_ParseTuple() succeeds
taking False path
1393 return NULL;
1394
1395 index = Pa_GetDefaultInputDevice();
1396 if (index == paNoDevice) {
when considering range: -0x80000000 <= value <= -2
taking False path
1397 PyErr_SetString(PyExc_IOError, "No Default Input Device Available");
1398 return NULL;
1399 } else if (index < 0) {
taking True path
1400
1401 #ifdef VERBOSE
1402 fprintf(stderr, "An error occured while using the portaudio stream\n");
1403 fprintf(stderr, "Error number: %d\n", index);
1404 fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(index));
1405 #endif
1406
1407 PyErr_SetObject(PyExc_IOError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue allocated at: PyErr_SetObject(PyExc_IOError,
ob_refcnt is now refs: 1 + N where N >= 0
ob_refcnt is now refs: 1 + N where N >= 1
1408 Py_BuildValue("(s,i)",
1409 Pa_GetErrorText(index), index));
1410 return NULL;
1411 }
1412
1413 return PyInt_FromLong(index);
1414 }
ob_refcnt of new ref from call to Py_BuildValue is 1 too high
was expecting final ob_refcnt to be N + 0 (for some unknown N)
but final ob_refcnt is N + 1