summaryrefslogtreecommitdiffstats
path: root/Lib/aifc.py
diff options
context:
space:
mode:
authorBrett Cannon <brett@python.org>2022-04-07 19:27:35 (GMT)
committerGitHub <noreply@github.com>2022-04-07 19:27:35 (GMT)
commit87eec70d97b250f820325b4f1b4f781b443b5180 (patch)
treef8e20384e332b2c5743c134d87a82070cee87ff7 /Lib/aifc.py
parent1df4298b62fcc124ba9de861f8dc8239ad72cde2 (diff)
downloadcpython-87eec70d97b250f820325b4f1b4f781b443b5180.zip
cpython-87eec70d97b250f820325b4f1b4f781b443b5180.tar.gz
cpython-87eec70d97b250f820325b4f1b4f781b443b5180.tar.bz2
Deprecate audioop (GH-32392)
Diffstat (limited to 'Lib/aifc.py')
-rw-r--r--Lib/aifc.py32
1 files changed, 24 insertions, 8 deletions
diff --git a/Lib/aifc.py b/Lib/aifc.py
index b5eab92..314cfd2 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -451,15 +451,21 @@ class Aifc_read:
#
def _alaw2lin(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.alaw2lin(data, 2)
def _ulaw2lin(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.ulaw2lin(data, 2)
def _adpcm2lin(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
if not hasattr(self, '_adpcmstate'):
# first time
self._adpcmstate = None
@@ -467,7 +473,9 @@ class Aifc_read:
return data
def _sowt2lin(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.byteswap(data, 2)
def _read_comm_chunk(self, chunk):
@@ -774,22 +782,30 @@ class Aifc_write:
#
def _lin2alaw(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.lin2alaw(data, 2)
def _lin2ulaw(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.lin2ulaw(data, 2)
def _lin2adpcm(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
if not hasattr(self, '_adpcmstate'):
self._adpcmstate = None
data, self._adpcmstate = audioop.lin2adpcm(data, 2, self._adpcmstate)
return data
def _lin2sowt(self, data):
- import audioop
+ with warnings.catch_warnings():
+ warnings.simplefilter('ignore', category=DeprecationWarning)
+ import audioop
return audioop.byteswap(data, 2)
def _ensure_header_written(self, datasize):