diff --git a/Lib/test/test_imgfile.py b/Lib/test/test_imgfile.py index ecc02ea67ae..39e891769d1 100755 --- a/Lib/test/test_imgfile.py +++ b/Lib/test/test_imgfile.py @@ -4,9 +4,10 @@ Roger E. Masse """ -from test.test_support import verbose, unlink, findfile +from test.test_support import verbose, unlink, findfile, import_module -import imgfile, uu +imgfile = import_module('imgfile', deprecated=True) +import uu def testimage(name): diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index b7199a3c30e..1d0c37fad7a 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -134,7 +134,7 @@ class TestStdlibRemovals(unittest.TestCase): inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb', 'cdplayer', 'CL', 'cl', 'DEVICE', 'GL', 'gl', 'ERRNO', 'FILE', 'FL', 'flp', 'fl', - 'fm', 'GET', 'GLWS'), + 'fm', 'GET', 'GLWS', 'imgfile'), 'darwin' : ('autoGIL', 'Carbon', 'OSATerminology', 'icglue', 'Nav', 'MacOS', 'aepack', 'aetools', 'aetypes', 'applesingle', diff --git a/Misc/NEWS b/Misc/NEWS index 3f7a6e008a3..0339353c4c2 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,8 @@ Extension Modules Library ------- +- The imgfile module from IRIX has been deprecated for removal in Python 3.0. + - The GLWS module from IRIX has been deprecated for removal in Python 3.0. - The GET module from IRIX has been deprecated for removal in Python 3.0. diff --git a/Modules/imgfile.c b/Modules/imgfile.c index bb85a78d5c2..baa6eadb4a7 100644 --- a/Modules/imgfile.c +++ b/Modules/imgfile.c @@ -491,6 +491,11 @@ void initimgfile(void) { PyObject *m, *d; + + if (PyErr_WarnPy3k("the imgfile module has been removed in " + "Python 3.0", 2) < 0) + return; + m = Py_InitModule("imgfile", imgfile_methods); if (m == NULL) return;