From 2551a6c92f247eed8121b14f151acd95432dff9e Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 21 Apr 2022 19:28:34 -0700 Subject: gh-91217: deprecate-pipes (GH-91779) --- Doc/whatsnew/3.11.rst | 1 + Lib/pipes.py | 3 +++ Lib/test/test_pipes.py | 4 +++- .../NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst | 1 + 4 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst diff --git a/Doc/whatsnew/3.11.rst b/Doc/whatsnew/3.11.rst index c3a8a7e..75ea70b 100644 --- a/Doc/whatsnew/3.11.rst +++ b/Doc/whatsnew/3.11.rst @@ -919,6 +919,7 @@ Deprecated * :mod:`nis` * :mod:`nntplib` * :mod:`ossaudiodev` + * :mod:`pipes` (Contributed by Brett Cannon in :issue:`47061`.) diff --git a/Lib/pipes.py b/Lib/pipes.py index 8cc74b0..61d63b4 100644 --- a/Lib/pipes.py +++ b/Lib/pipes.py @@ -60,10 +60,13 @@ To create a new template object initialized to a given one: import re import os import tempfile +import warnings # we import the quote function rather than the module for backward compat # (quote used to be an undocumented but used function in pipes) from shlex import quote +warnings._deprecated(__name__, remove=(3, 13)) + __all__ = ["Template"] # Conversion step kinds diff --git a/Lib/test/test_pipes.py b/Lib/test/test_pipes.py index 6335e7c..09e2115 100644 --- a/Lib/test/test_pipes.py +++ b/Lib/test/test_pipes.py @@ -1,10 +1,12 @@ -import pipes import os import string import unittest import shutil from test.support import reap_children, unix_shell from test.support.os_helper import TESTFN, unlink +from test.support.warnings_helper import import_deprecated + +pipes = import_deprecated("pipes") if os.name != 'posix': diff --git a/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst b/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst new file mode 100644 index 0000000..fc8ed57 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-04-17-12-07-50.gh-issue-91217.TIvrsq.rst @@ -0,0 +1 @@ +Deprecate the 'pipes' module. -- cgit v0.12