Skip to content

Commit 0b2ba35

Browse files
author
brett.cannon
committed
Depreate imageop for removal in 3.0.
git-svn-id: http://svn.python.org/projects/python/trunk@63114 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent abd8695 commit 0b2ba35

5 files changed

Lines changed: 15 additions & 7 deletions

File tree

Doc/library/imageop.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
.. module:: imageop
66
:synopsis: Manipulate raw image data.
7-
7+
:deprecated:
8+
9+
.. deprecated:: 2.6
10+
The :mod:`imageop` module has been removed in Python 3.0.
811

912
The :mod:`imageop` module contains some useful operations on images. It operates
1013
on images consisting of 8 or 32 bit pixels stored in Python strings. This is

Lib/test/test_imageop.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@
55
Roger E. Masse
66
"""
77

8-
from test.test_support import verbose, unlink
8+
from test.test_support import verbose, unlink, import_module
99

10-
import imageop, uu, os, imgfile
11-
12-
import warnings
10+
imageop = import_module('imageop', deprecated=True)
11+
import uu, os, imgfile
1312

1413
def test_main():
1514

Lib/test/test_py3kwarn.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,7 @@ class TestStdlibRemovals(unittest.TestCase):
132132
'Bastion', 'compiler', 'dircache', 'fpformat',
133133
'ihooks', 'mhlib')
134134
inclusive_platforms = {'irix':('pure',)}
135-
# XXX Don't know if lib-tk is only installed if _tkinter is built.
136-
optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev')
135+
optional_modules = ('bsddb185', 'Canvas', 'dl', 'linuxaudiodev', 'imageop')
137136

138137
def check_removal(self, module_name, optional=False):
139138
"""Make sure the specified module, when imported, raises a

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Extension Modules
2323
Library
2424
-------
2525

26+
- The imageop module has been deprecated for removal in Python 3.0.
27+
2628
- #2250: Exceptions raised during evaluation of names in rlcompleter's
2729
``Completer.complete()`` method are now caught and ignored.
2830

Modules/imageop.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,11 @@ PyMODINIT_FUNC
775775
initimageop(void)
776776
{
777777
PyObject *m;
778+
779+
if (PyErr_WarnPy3k("the imageop module has been removed in "
780+
"Python 3.0", 2) < 0)
781+
return;
782+
778783
m = Py_InitModule("imageop", imageop_methods);
779784
if (m == NULL)
780785
return;

0 commit comments

Comments
 (0)