]> granicus.if.org Git - python/commitdiff
Adding a warning about the regex module. This is the first official
authorGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 18:21:39 +0000 (18:21 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 19 Dec 2000 18:21:39 +0000 (18:21 +0000)
use of PyErr_Warn()!  This module is a good guinea pig because it's
been obsolete since 1.5.0 was released.

Modules/regexmodule.c

index 749de9e7ab48632ccfb5a82d235d9f51e6e38c99..da1fc3e4e2b6d104b5f8b693d3c22254b65e60c8 100644 (file)
@@ -656,6 +656,9 @@ initregex(void)
        
        m = Py_InitModule("regex", regex_global_methods);
        d = PyModule_GetDict(m);
+
+       PyErr_Warn(PyExc_DeprecationWarning,
+               "the regex module is deprecated; please use the re module");
        
        /* Initialize regex.error exception */
        v = RegexError = PyErr_NewException("regex.error", NULL, NULL);