diff options
author | Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com> | 2020-04-27 17:27:07 +0800 |
---|---|---|
committer | Kai-Chuan Hsieh <kaichuan.hsieh@canonical.com> | 2020-04-27 17:56:38 +0800 |
commit | bf5028fb136eeae3b8a45e406e5e7f2e4bde55dd (patch) | |
tree | 20ae615765efe521e9aa091571015628f1dc80a3 /bin | |
parent | ec3f9be01e83cb7aa89032b0031a8d7cdb382b52 (diff) |
Using abstraction base class Callable under collections.abc. (LP: #1875310)
fix issue below: audio_test:127: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working if not isinstance(method, collections.Callable):
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/audio_test | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/audio_test b/bin/audio_test index 466b7602..7bd6c441 100755 --- a/bin/audio_test +++ b/bin/audio_test @@ -24,6 +24,10 @@ except ImportError: print((sys.version), file=sys.stderr) sys.exit(127) +try: + from collections.abc import Callable +except ImportError: + from collections import Callable # backward compatible #Frequency bands for FFT BINS = 256 @@ -124,7 +128,7 @@ class PAVolumeController(object): self._volume = None self.identifier = None self.method = method - if not isinstance(method, collections.Callable): + if not isinstance(method, Callable): self.method = self._pactl_output self.logger = logger |