summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrett Cannon <bcannon@gmail.com>2008-05-12 00:08:34 (GMT)
committerBrett Cannon <bcannon@gmail.com>2008-05-12 00:08:34 (GMT)
commit42bfa90f02f0055ea163df9103ebed873ee1dbb0 (patch)
tree21b36e7ba36b42f58780624d900a5ca68d33a31f
parentb61d801adbb7dd13ed1f2706fe537cae970bcfa6 (diff)
downloadcpython-42bfa90f02f0055ea163df9103ebed873ee1dbb0.zip
cpython-42bfa90f02f0055ea163df9103ebed873ee1dbb0.tar.gz
cpython-42bfa90f02f0055ea163df9103ebed873ee1dbb0.tar.bz2
Depreate imageop for removal in 3.0.
-rw-r--r--Doc/library/imageop.rst5
-rwxr-xr-xLib/test/test_imageop.py7
-rw-r--r--Lib/test/test_py3kwarn.py3
-rw-r--r--Misc/NEWS2
-rw-r--r--Modules/imageop.c5
5 files changed, 15 insertions, 7 deletions
diff --git a/Doc/library/imageop.rst b/Doc/library/imageop.rst
index 8ced5bd..758d23c 100644
--- a/Doc/library/imageop.rst
+++ b/Doc/library/imageop.rst
@@ -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
diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py
index 3b14357..8cd2dc1 100755
--- a/Lib/test/test_imageop.py
+++ b/Lib/test/test_imageop.py
@@ -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():
diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py
index 85a772d..a4c24d4 100644
--- a/Lib/test/test_py3kwarn.py
+++ b/Lib/test/test_py3kwarn.py
@@ -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
diff --git a/Misc/NEWS b/Misc/NEWS
index 230632e..252dbe3 100644
--- 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.
diff --git a/Modules/imageop.c b/Modules/imageop.c
index 92f805a..f67cd60 100644
--- a/Modules/imageop.c
+++ b/Modules/imageop.c
@@ -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;