]> granicus.if.org Git - python/commitdiff
Add deprecation warning to modules deprecated since 2000.
authorGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 11:29:04 +0000 (11:29 +0000)
committerGeorg Brandl <georg@python.org>
Fri, 17 Feb 2006 11:29:04 +0000 (11:29 +0000)
Lib/gopherlib.py
Modules/rgbimgmodule.c

index 01eab0a3d989a65b3ce573029a00a93fe9816b87..226eda6e9826303e0865ba9156e9b97559dc4726 100644 (file)
@@ -2,6 +2,9 @@
 
 __all__ = ["send_selector","send_query"]
 
+import warnings
+warnings.warn("the gopherlib module is deprecated", DeprecationWarning)
+
 # Default selector, host and port
 DEF_SELECTOR = '1/'
 DEF_HOST     = 'gopher.micro.umn.edu'
index 67b5521092615b169b3766390cf7e4462bc9b04f..a2b91c4b2a36d4eab35ac282aed5e7f0f00d724e 100644 (file)
@@ -759,6 +759,11 @@ initrgbimg(void)
        m = Py_InitModule("rgbimg", rgbimg_methods);
        if (m == NULL)
                return;
+
+       if (PyErr_Warn(PyExc_DeprecationWarning, 
+                               "the rgbimg module is deprecated"))
+               return;
+       
        d = PyModule_GetDict(m);
        ImgfileError = PyErr_NewException("rgbimg.error", NULL, NULL);
        if (ImgfileError != NULL)