From ebcab23e468a72fb00efce3f23bc73ca120ba1cd Mon Sep 17 00:00:00 2001 From: Kai-Chuan Hsieh Date: Mon, 27 Apr 2020 17:27:07 +0800 Subject: 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): --- bin/audio_test | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'bin') 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 -- cgit v1.2.3