mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-37320: Remove openfp() of aifc, sunau and wave (GH-14169)
aifc.openfp() alias to aifc.open(), sunau.openfp() alias to sunau.open(), and wave.openfp() alias to wave.open() have been removed. They were deprecated since Python 3.7.
This commit is contained in:
parent
8fac122109
commit
ac7b1a3f32
12 changed files with 29 additions and 69 deletions
20
Lib/wave.py
20
Lib/wave.py
|
@ -71,9 +71,15 @@ The close() method is called automatically when the class instance
|
|||
is destroyed.
|
||||
"""
|
||||
|
||||
from chunk import Chunk
|
||||
from collections import namedtuple
|
||||
import audioop
|
||||
import builtins
|
||||
import struct
|
||||
import sys
|
||||
|
||||
__all__ = ["open", "openfp", "Error", "Wave_read", "Wave_write"]
|
||||
|
||||
__all__ = ["open", "Error", "Wave_read", "Wave_write"]
|
||||
|
||||
class Error(Exception):
|
||||
pass
|
||||
|
@ -82,13 +88,6 @@ WAVE_FORMAT_PCM = 0x0001
|
|||
|
||||
_array_fmts = None, 'b', 'h', None, 'i'
|
||||
|
||||
import audioop
|
||||
import struct
|
||||
import sys
|
||||
from chunk import Chunk
|
||||
from collections import namedtuple
|
||||
import warnings
|
||||
|
||||
_wave_params = namedtuple('_wave_params',
|
||||
'nchannels sampwidth framerate nframes comptype compname')
|
||||
|
||||
|
@ -512,8 +511,3 @@ def open(f, mode=None):
|
|||
return Wave_write(f)
|
||||
else:
|
||||
raise Error("mode must be 'r', 'rb', 'w', or 'wb'")
|
||||
|
||||
def openfp(f, mode=None):
|
||||
warnings.warn("wave.openfp is deprecated since Python 3.7. "
|
||||
"Use wave.open instead.", DeprecationWarning, stacklevel=2)
|
||||
return open(f, mode=mode)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue