From 7292e921fc9b0128a2224eb4cd45c2649211c9cf Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 19 Dec 2000 18:25:58 +0000 Subject: [PATCH] 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 :-). --- Lib/regsub.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Lib/regsub.py b/Lib/regsub.py index dc95028b344..a0ca8fe41e2 100644 --- a/Lib/regsub.py +++ b/Lib/regsub.py @@ -10,6 +10,13 @@ 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