aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Curtin <brian@python.org>2017-11-10 11:38:25 -0500
committerGitHub <noreply@github.com>2017-11-10 11:38:25 -0500
commit9f914a01affc55abe799afc521ce71612bb495a5 (patch)
treeb002fd748ecccf5a416b655a85aef7fb30bd6633 /Lib/aifc.py
parentbpo-31999: Fix test_venv in case the zlib module is not available. (#4359) (diff)
downloadcpython-9f914a01affc55abe799afc521ce71612bb495a5.tar.gz
cpython-9f914a01affc55abe799afc521ce71612bb495a5.tar.bz2
cpython-9f914a01affc55abe799afc521ce71612bb495a5.zip
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
The openfp functions of aifp, sunau, and wave had pointed to the open function of each module since 1993 as a matter of backwards compatibility. In the case of aifc.openfp, it was both undocumented and untested. This change begins the formal deprecation of those openfp functions, with their removal coming in 3.9. This additionally adds a TODO in test_pyclbr around using aifc.openfp, though it shouldn't be changed until removal in 3.9.
Diffstat (limited to 'Lib/aifc.py')
-rw-r--r--Lib/aifc.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/aifc.py b/Lib/aifc.py
index 49a456a893f..e51e8f8e484 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -915,7 +915,10 @@ def open(f, mode=None):
else:
raise Error("mode must be 'r', 'rb', 'w', or 'wb'")
-openfp = open # B/W compatibility
+def openfp(f, mode=None):
+ warnings.warn("aifc.openfp is deprecated since Python 3.7. "
+ "Use aifc.open instead.", DeprecationWarning, stacklevel=2)
+ return open(f, mode=mode)
if __name__ == '__main__':
import sys