]> granicus.if.org Git - python/commitdiff
Adding a warning about the regsub module. This also disables further
authorGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 18:25:58 +0000 (18:25 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 18:25:58 +0000 (18:25 +0000)
warnings in this same module, to prevent getting a warning about
importing regex (we *know* that it's obsolete :-).

Lib/regsub.py

index dc95028b34494af8adaa2d823c00b17848661a48..a0ca8fe41e26fd5c4671ae8e72ff253e55a4f63f 100644 (file)
@@ -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