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 | ebcab23e468a72fb00efce3f23bc73ca120ba1cd (patch) | |
tree | 97fdefa29d8b27347733ad541899b44890e43d10 /bin | |
parent | 5a7e87e661aa962b989b462cf1b53194b4fd8280 (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 466b760..7bd6c44 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 |