summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2017-08-19 17:15:16 +0200
committerMatthias Geier <Matthias.Geier@gmail.com>2017-08-19 17:15:16 +0200
commit9af4e43a387e312e1c79e35eacb65b138b816c83 (patch)
tree98a3c5d465cfd5f28979906f8fb1d271249fac72
parent8370db2cf4ff08a23119824f2cecd08ad15a1165 (diff)
For .active property, check for .closed first
This way, a closed stream can be active==False instead of throwing an exception.
-rw-r--r--sounddevice.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/sounddevice.py b/sounddevice.py
index 4152aa8..08ce34c 100644
--- a/sounddevice.py
+++ b/sounddevice.py
@@ -1162,6 +1162,8 @@ class _StreamBase(object):
stopped
"""
+ if self.closed:
+ return False
return _check(_lib.Pa_IsStreamActive(self._ptr)) == 1
@property