From 650f5161f45390bc3b621bc7db9edfd54e7f59b9 Mon Sep 17 00:00:00 2001 From: Brett Cannon Date: Wed, 14 May 2008 21:12:12 +0000 Subject: [PATCH] Deprecate CL, CL_old, and cl for 3.0. --- Lib/plat-irix5/CL.py | 4 ++++ Lib/plat-irix5/CL_old.py | 4 ++++ Lib/plat-irix6/CL.py | 4 ++++ Lib/test/test_py3kwarn.py | 2 +- Misc/NEWS | 3 +++ Modules/clmodule.c | 6 +++++- 6 files changed, 21 insertions(+), 2 deletions(-) diff --git a/Lib/plat-irix5/CL.py b/Lib/plat-irix5/CL.py index 23259c55489..15130e4306e 100755 --- a/Lib/plat-irix5/CL.py +++ b/Lib/plat-irix5/CL.py @@ -1,5 +1,9 @@ # Backward compatible module CL. # All relevant symbols are now defined in the module cl. +from warnings import warnpy3k +warnpy3k("the CL module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + try: from cl import * except ImportError: diff --git a/Lib/plat-irix5/CL_old.py b/Lib/plat-irix5/CL_old.py index 967b49708c8..892f86c0114 100755 --- a/Lib/plat-irix5/CL_old.py +++ b/Lib/plat-irix5/CL_old.py @@ -8,6 +8,10 @@ # # originalFormat parameter values # +from warnings import warnpy3k +warnpy3k("the CL_old module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + MAX_NUMBER_OF_ORIGINAL_FORMATS = 32 # Audio diff --git a/Lib/plat-irix6/CL.py b/Lib/plat-irix6/CL.py index 23259c55489..15130e4306e 100644 --- a/Lib/plat-irix6/CL.py +++ b/Lib/plat-irix6/CL.py @@ -1,5 +1,9 @@ # Backward compatible module CL. # All relevant symbols are now defined in the module cl. +from warnings import warnpy3k +warnpy3k("the CL module has been removed in Python 3.0", stacklevel=2) +del warnpy3k + try: from cl import * except ImportError: diff --git a/Lib/test/test_py3kwarn.py b/Lib/test/test_py3kwarn.py index 2b9eac43e4b..78dd53d8577 100644 --- a/Lib/test/test_py3kwarn.py +++ b/Lib/test/test_py3kwarn.py @@ -132,7 +132,7 @@ class TestStdlibRemovals(unittest.TestCase): 'Bastion', 'compiler', 'dircache', 'fpformat', 'ihooks', 'mhlib') inclusive_platforms = {'irix' : ('pure', 'AL', 'al', 'CD', 'cd', 'cddb', - 'cdplayer'), + 'cdplayer', 'CL', 'cl'), 'darwin' : ('autoGIL', 'Carbon', 'OSATerminology', 'icglue', 'Nav', 'MacOS', 'aepack', 'aetools', 'aetypes', 'applesingle', diff --git a/Misc/NEWS b/Misc/NEWS index 659cf72316a..71d34cdc75b 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -32,6 +32,9 @@ Extension Modules Library ------- +- The CL, CL_old, and cl modules for IRIX have been deprecated for removal in + Python 3.0. + - The cdplayer module for IRIX has been deprecated for removal in Python 3.0. - The cddb module for IRIX has been deprecated for removal in Python 3.0. diff --git a/Modules/clmodule.c b/Modules/clmodule.c index a535e031f53..d3e0edf3e5b 100644 --- a/Modules/clmodule.c +++ b/Modules/clmodule.c @@ -961,7 +961,11 @@ void initcl(void) { PyObject *m, *d, *x; - + + if (PyErr_WarnPy3k("the cl module has been removed in " + "Python 3.0", 2) < 0) + return; + m = Py_InitModule("cl", cl_methods); if (m == NULL) return;