summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2015-07-06 11:22:59 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2015-07-06 11:22:59 +0200
commit6a8fe13923dd56d516b197e12c532165b4368934 (patch)
treea282cebe9ba59dd4099c32fae0d59497957646ac
parent4babf25a46c523cde021c26db3d2d6f840fd2913 (diff)
Minor cosmetic change in error handling
-rw-r--r--sounddevice.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/sounddevice.py b/sounddevice.py
index 170be79..71e7a32 100644
--- a/sounddevice.py
+++ b/sounddevice.py
@@ -993,9 +993,8 @@ class _StreamBase(object):
"""
err = _lib.Pa_StartStream(self._ptr)
- if err == _lib.paStreamIsNotStopped:
- return
- _check(err, "Error starting stream")
+ if err != _lib.paStreamIsNotStopped:
+ _check(err, "Error starting stream")
def stop(self):
"""Terminate audio processing.
@@ -1009,9 +1008,8 @@ class _StreamBase(object):
"""
err = _lib.Pa_StopStream(self._ptr)
- if err == _lib.paStreamIsStopped:
- return
- _check(err, "Error stopping stream")
+ if err != _lib.paStreamIsStopped:
+ _check(err, "Error stopping stream")
def abort(self):
"""Terminate audio processing immediately.
@@ -1024,9 +1022,8 @@ class _StreamBase(object):
"""
err = _lib.Pa_AbortStream(self._ptr)
- if err == _lib.paStreamIsStopped:
- return
- _check(err, "Error aborting stream")
+ if err != _lib.paStreamIsStopped:
+ _check(err, "Error aborting stream")
def close(self, ignore_errors=True):
"""Close the stream.