Skip to content

Commit 9af4e43

Browse files
committed
For .active property, check for .closed first
This way, a closed stream can be active==False instead of throwing an exception.
1 parent 8370db2 commit 9af4e43

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sounddevice.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,8 @@ def active(self):
11621162
stopped
11631163
11641164
"""
1165+
if self.closed:
1166+
return False
11651167
return _check(_lib.Pa_IsStreamActive(self._ptr)) == 1
11661168

11671169
@property

0 commit comments

Comments
 (0)