]> granicus.if.org Git - python/commitdiff
Depreate imageop for removal in 3.0.
authorBrett Cannon <bcannon@gmail.com>
Mon, 12 May 2008 00:08:34 +0000 (00:08 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 12 May 2008 00:08:34 +0000 (00:08 +0000)
Doc/library/imageop.rst
Lib/test/test_imageop.py
Lib/test/test_py3kwarn.py
Misc/NEWS
Modules/imageop.c

index 8ced5bd5bbfb424e1239752e97db04335011e1c2..758d23ca6845d6880ac5e4c64278c5c771170795 100644 (file)
@@ -4,7 +4,10 @@
 
 .. module:: imageop
    :synopsis: Manipulate raw image data.
-
+   :deprecated:
+   
+.. deprecated:: 2.6
+    The :mod:`imageop` module has been removed in Python 3.0.
 
 The :mod:`imageop` module contains some useful operations on images. It operates
 on images consisting of 8 or 32 bit pixels stored in Python strings.  This is
index 3b14357483c18783fd9fbad05986864a12d5bab2..8cd2dc11bd87339510109f74f95c08751e6a8ac3 100755 (executable)
@@ -5,11 +5,10 @@
    Roger E. Masse
 """
 
-from test.test_support import verbose, unlink
+from test.test_support import verbose, unlink, import_module
 
-import imageop, uu, os, imgfile
-
-import warnings
+imageop = import_module('imageop', deprecated=True)
+import uu, os, imgfile
 
 def test_main():
 
index 85a772d6123c7786dcb23622c68474bd1a1beee9..a4c24d418201946ab77fbdb00c27c7b86bbe31e4 100644 (file)
@@ -132,8 +132,7 @@ class TestStdlibRemovals(unittest.TestCase):
                         'Bastion', 'compiler', 'dircache', 'fpformat',
                         'ihooks', 'mhlib')
     inclusive_platforms = {'irix':('pure',)}
-    # XXX Don't know if lib-tk is only installed if _tkinter is built.
-    optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev')
+    optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop')
 
     def check_removal(self, module_name, optional=False):
         """Make sure the specified module, when imported, raises a
index 230632e02e5698518683288b0535c5aec3300045..252dbe3fa97d9682b7adf444df7713db054383ad 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -23,6 +23,8 @@ Extension Modules
 Library
 -------
 
+- The imageop module has been deprecated for removal in Python 3.0.
+
 - #2250: Exceptions raised during evaluation of names in rlcompleter's
   ``Completer.complete()`` method are now caught and ignored.
 
index 92f805a83b62f338d39019bf5489ee1a3ceccb58..f67cd60dd47c1aa1cc4be862312419d4d4380a2a 100644 (file)
@@ -775,6 +775,11 @@ PyMODINIT_FUNC
 initimageop(void)
 {
        PyObject *m;
+       
+       if (PyErr_WarnPy3k("the imageop module has been removed in "
+                          "Python 3.0", 2) < 0)
+           return;
+       
        m = Py_InitModule("imageop", imageop_methods);
        if (m == NULL)
                return;