diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index 5f1f995a0fe..3ba35a8620a 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -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`.) diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py index 3df5f264ced..226b70ae87b 100644 --- a/Lib/test/test_xdrlib.py +++ b/Lib/test/test_xdrlib.py @@ -1,6 +1,8 @@ import unittest +from test.support import warnings_helper + +xdrlib = warnings_helper.import_deprecated("xdrlib") -import xdrlib class XDRTest(unittest.TestCase): diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py index d6e1aeb5272..b56ffa59b73 100644 --- a/Lib/xdrlib.py +++ b/Lib/xdrlib.py @@ -7,6 +7,9 @@ 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 index 00000000000..14f2c4d0649 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-21-21-06-54.gh-issue-91217.2cVma_.rst @@ -0,0 +1 @@ +Deprecate the xdrlib module.