[Python-checkins] r63114 - in python/trunk: Doc/library/imageop.rst Lib/test/test_imageop.py Lib/test/test_py3kwarn.py Misc/NEWS Modules/imageop.c

brett.cannon python-checkins at python.org
Mon May 12 02:08:35 CEST 2008


Author: brett.cannon
Date: Mon May 12 02:08:34 2008
New Revision: 63114

Log:
Depreate imageop for removal in 3.0.


Modified:
   python/trunk/Doc/library/imageop.rst
   python/trunk/Lib/test/test_imageop.py
   python/trunk/Lib/test/test_py3kwarn.py
   python/trunk/Misc/NEWS
   python/trunk/Modules/imageop.c

Modified: python/trunk/Doc/library/imageop.rst
==============================================================================
--- python/trunk/Doc/library/imageop.rst	(original)
+++ python/trunk/Doc/library/imageop.rst	Mon May 12 02:08:34 2008
@@ -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

Modified: python/trunk/Lib/test/test_imageop.py
==============================================================================
--- python/trunk/Lib/test/test_imageop.py	(original)
+++ python/trunk/Lib/test/test_imageop.py	Mon May 12 02:08:34 2008
@@ -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():
 

Modified: python/trunk/Lib/test/test_py3kwarn.py
==============================================================================
--- python/trunk/Lib/test/test_py3kwarn.py	(original)
+++ python/trunk/Lib/test/test_py3kwarn.py	Mon May 12 02:08:34 2008
@@ -132,8 +132,7 @@
                         '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

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Mon May 12 02:08:34 2008
@@ -23,6 +23,8 @@
 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.
 

Modified: python/trunk/Modules/imageop.c
==============================================================================
--- python/trunk/Modules/imageop.c	(original)
+++ python/trunk/Modules/imageop.c	Mon May 12 02:08:34 2008
@@ -775,6 +775,11 @@
 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;


More information about the Python-checkins mailing list