]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-91217: deprecate xdrlib (GH-92066)
authorBrett Cannon <brett@python.org>
Sat, 30 Apr 2022 01:22:10 +0000 (18:22 -0700)
committerGitHub <noreply@github.com>
Sat, 30 Apr 2022 01:22:10 +0000 (18:22 -0700)
Automerge-Triggered-By: GH:brettcannon
Doc/whatsnew/3.11.rst
Lib/test/test_xdrlib.py
Lib/xdrlib.py
Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst [new file with mode: 0644]

index 5f1f995a0fe2f8e86e716cd4f4d9a5acb956d4c2..3ba35a8620a56185327d58a34a1656dff2150c7e 100644 (file)
@@ -1081,6 +1081,7 @@ Deprecated
   * :mod:`sunau`
   * :mod:`telnetlib`
   * :mod:`uu`
+  * :mod:`xdrlib`
 
   (Contributed by Brett Cannon in :issue:`47061` and Victor Stinner in
   :gh:`68966`.)
index 3df5f264ced463604154c5d1d257f65367dbd4c8..226b70ae87b0b41cf6489ce01cd5fbf2570d2fc9 100644 (file)
@@ -1,6 +1,8 @@
 import unittest
+from test.support import warnings_helper
+
+xdrlib = warnings_helper.import_deprecated("xdrlib")
 
-import xdrlib
 
 class XDRTest(unittest.TestCase):
 
index d6e1aeb527266af97f0338806a673894ec2f3c64..b56ffa59b73dcba1241ba0b181f2dd593389945a 100644 (file)
@@ -7,6 +7,9 @@ See: RFC 1014
 import struct
 from io import BytesIO
 from functools import wraps
+import warnings
+
+warnings._deprecated(__name__, remove=(3, 13))
 
 __all__ = ["Error", "Packer", "Unpacker", "ConversionError"]
 
diff --git a/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst b/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst
new file mode 100644 (file)
index 0000000..14f2c4d
--- /dev/null
@@ -0,0 +1 @@
+Deprecate the xdrlib module.