2134 static PyObject *
2135 pa_abort_stream(PyObject *self, PyObject *args)
2136 {
2137 int err;
2138 PyObject *stream_arg;
2139 _pyAudio_Stream *streamObject;
2140 PaStream *stream;
2141
2142 if (!PyArg_ParseTuple(args, "O!", &_pyAudio_StreamType, &stream_arg))
when PyArg_ParseTuple() succeeds
taking False path
2143 return NULL;
2144
2145 streamObject = (_pyAudio_Stream *) stream_arg;
2146
2147 if (!_is_open(streamObject)) {
when considering range: -0x80000000 <= value <= -1
taking False path
2148 PyErr_SetString(PyExc_IOError, "Stream not open");
2149 return NULL;
2150 }
2151
2152 stream = streamObject->stream;
2153
2154 Py_BEGIN_ALLOW_THREADS
releasing the GIL by calling PyEval_SaveThread()
2155 err = Pa_AbortStream(stream);
2156 Py_END_ALLOW_THREADS
reacquiring the GIL by calling PyEval_RestoreThread()
2157
2158 if ((err != paNoError) && (err != paStreamIsStopped)) {
when considering range: -0x80000000 <= value <= -1
when considering range: -0x80000000 <= value <= -9984
taking True path
2159 _cleanup_Stream_object(streamObject);
2160
2161 #ifdef VERBOSE
2162 fprintf(stderr, "An error occured while using the portaudio stream\n");
2163 fprintf(stderr, "Error number: %d\n", err);
2164 fprintf(stderr, "Error message: %s\n", Pa_GetErrorText(err));
2165 #endif
2166
2167 PyErr_SetObject(PyExc_IOError,
when Py_BuildValue() succeeds
calling PyErr_SetObject()
new ref from call to Py_BuildValue was allocated at: PyErr_SetObject(PyExc_IOError,
ob_refcnt is now refs: 1 owned
ob_refcnt is now refs: 1 owned, 1 borrowed
2168 Py_BuildValue("(s,i)",
2169 Pa_GetErrorText(err),
2170 err));
2171 return NULL;
2172 }
2173
2174 Py_INCREF(Py_None);
2175 return Py_None;
2176 }