Skip to content

Commit 8f07897

Browse files
authored
Merge pull request #141 from juligreen/master
Replace collections.Iterable with collections.abc.Iterable
2 parents 8c7da87 + ac49a71 commit 8f07897

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

soundcard/coreaudio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ def __init__(self, iotype, device, samplerate, channels, blocksize):
465465
.format(self.blocksizerange[0],
466466
maxblocksize))
467467

468-
if isinstance(channels, collections.Iterable):
468+
if isinstance(channels, collections.abc.Iterable):
469469
if iotype == 'output':
470470
# invert channel map and fill with -1 ([2, 0] -> [1, -1, 0]):
471471
self.channels = len([c for c in channels if c >= 0])

soundcard/mediafoundation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ def __init__(self, ptr, samplerate, channels, blocksize, isloopback, exclusive_m
487487

488488
if isinstance(channels, int):
489489
self.channelmap = list(range(channels))
490-
elif isinstance(channels, collections.Iterable):
490+
elif isinstance(channels, collections.abc.Iterable):
491491
self.channelmap = channels
492492
else:
493493
raise TypeError('channels must be iterable or integer')

soundcard/pulseaudio.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ def __enter__(self):
639639
samplespec = _ffi.new("pa_sample_spec*")
640640
samplespec.format = _pa.PA_SAMPLE_FLOAT32LE
641641
samplespec.rate = self._samplerate
642-
if isinstance(self.channels, collections.Iterable):
642+
if isinstance(self.channels, collections.abc.Iterable):
643643
samplespec.channels = len(self.channels)
644644
elif isinstance(self.channels, int):
645645
samplespec.channels = self.channels
@@ -652,7 +652,7 @@ def __enter__(self):
652652
# names to avoid garbage collection trouble on the Python/C boundary
653653
pam = _ffi.new("pa_channel_map*")
654654
channelmap = _pa.pa_channel_map_init_auto(pam, samplespec.channels, _pa.PA_CHANNEL_MAP_DEFAULT)
655-
if isinstance(self.channels, collections.Iterable):
655+
if isinstance(self.channels, collections.abc.Iterable):
656656
for idx, ch in enumerate(self.channels):
657657
channelmap.map[idx] = ch+1
658658
if not _pa.pa_channel_map_valid(channelmap):

0 commit comments

Comments
 (0)