From 044616aa244a7b78c27d774143ad17a72467d4ef Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Thu, 15 May 2008 02:33:55 +0000 Subject: Deprecate DEVICE, GL, gl, and the related modules cgen and cgensupport for removal in 3.0. --- Lib/plat-irix5/DEVICE.py | 4 ++++ Lib/plat-irix5/GL.py | 4 ++++ Lib/plat-irix6/DEVICE.py | 4 ++++ Lib/plat-irix6/GL.py | 4 ++++ Lib/test/test_py3kwarn.py | 3 ++- Misc/NEWS | 5 ++++- Modules/cgen.py | 3 +++ Modules/glmodule.c | 5 +++++ 8 files changed, 30 insertions(+), 2 deletions(-) diff --git a/Lib/plat-irix5/DEVICE.py b/Lib/plat-irix5/DEVICE.py index 7ace8cb..14fd534 100755 --- a/Lib/plat-irix5/DEVICE.py +++ b/Lib/plat-irix5/DEVICE.py @@ -1,3 +1,7 @@ +from warnings import warnpy3k +warnpy3k("the DEVICE module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + NULLDEV = 0 BUTOFFSET = 1 VALOFFSET = 256 diff --git a/Lib/plat-irix5/GL.py b/Lib/plat-irix5/GL.py index 9f02f65..d0e0074 100755 --- a/Lib/plat-irix5/GL.py +++ b/Lib/plat-irix5/GL.py @@ -1,3 +1,7 @@ +from warnings import warnpy3k +warnpy3k("the GL module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + NULL = 0 FALSE = 0 TRUE = 1 diff --git a/Lib/plat-irix6/DEVICE.py b/Lib/plat-irix6/DEVICE.py index 7ace8cb..14fd534 100644 --- a/Lib/plat-irix6/DEVICE.py +++ b/Lib/plat-irix6/DEVICE.py @@ -1,3 +1,7 @@ +from warnings import warnpy3k +warnpy3k("the DEVICE module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + NULLDEV = 0 BUTOFFSET = 1 VALOFFSET = 256 diff --git a/Lib/plat-irix6/GL.py b/Lib/plat-irix6/GL.py index 9f02f65..d0e0074 100644 --- a/Lib/plat-irix6/GL.py +++ b/Lib/plat-irix6/GL.py @@ -1,3 +1,7 @@ +from warnings import warnpy3k +warnpy3k("the GL module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + NULL = 0 FALSE = 0 TRUE = 1 diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index e622284..4a08c51 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -132,7 +132,8 @@ class TestStdlibRemovals(unittest.TestCase): 'Bastion', 'compiler', 'dircache', 'fpformat', 'ihooks', 'mhlib') inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb', - 'cdplayer', 'CL', 'cl'), + 'cdplayer', 'CL', 'cl', 'DEVICE', 'GL', + 'gl'), 'darwin' : ('autoGIL', 'Carbon', 'OSATerminology', 'icglue', 'Nav', 'MacOS', 'aepack', 'aetools', 'aetypes', 'applesingle', diff --git a/Misc/NEWS b/Misc/NEWS index ebcaeda..1ff5284 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -25,13 +25,16 @@ Core and Builtins Extension Modules ----------------- -- Support for Windows9x has been removed from the winsound module. +- Support for Windows 9x has been removed from the winsound module. - bsddb module updated to version 4.6.4. Library ------- +- The DEVICE, GL, gl, and cgen modules (which indirectly includes cgensupport) + have been deprecated for removal in Python 3.0. + - The ConfigParser module has been renamed 'configparser'. The old name is now deprecated. diff --git a/Modules/cgen.py b/Modules/cgen.py index f07d984..c63962b 100644 --- a/Modules/cgen.py +++ b/Modules/cgen.py @@ -17,6 +17,9 @@ # # XXX BUG return arrays generate wrong code # XXX need to change error returns into gotos to free mallocked arrays +from warnings import warnpy3k +warnpy3k("the cgen module has been removed in Python 3.0", stacklevel=2) +del warnpy3k import string diff --git a/Modules/glmodule.c b/Modules/glmodule.c index 6590704..01db9fc 100644 --- a/Modules/glmodule.c +++ b/Modules/glmodule.c @@ -7624,5 +7624,10 @@ static struct PyMethodDef gl_methods[] = { void initgl(void) { + + if (PyErr_WarnPy3k("the gl module has been removed in " + "Python 3.0", 2) < 0) + return; + (void) Py_InitModule("gl", gl_methods); } -- cgit v0.12