From: Guido van Rossum Date: Tue, 19 Dec 2000 18:25:58 +0000 (+0000) Subject: Adding a warning about the regsub module. This also disables further X-Git-Tag: v2.1a1~520 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7292e921fc9b0128a2224eb4cd45c2649211c9cf;p=python Adding a warning about the regsub module. This also disables further warnings in this same module, to prevent getting a warning about importing regex (we *know* that it's obsolete :-). --- diff --git a/Lib/regsub.py b/Lib/regsub.py index dc95028b34..a0ca8fe41e 100644 --- a/Lib/regsub.py +++ b/Lib/regsub.py @@ -10,6 +10,13 @@ splitx(str, pat, maxsplit): split string using pattern as delimiter plus return delimiters """ +import warnings +warnings.warn("the regsub module is deprecated; please use re.sub()", + DeprecationWarning) + +# Ignore further deprecation warnings about this module +warnings.filterwarnings("ignore", "", DeprecationWarning, __name__) + import regex