[Python-checkins] r62966 - peps/trunk/pep-3108.txt
brett.cannon
python-checkins at python.org
Sat May 10 04:24:34 CEST 2008
Author: brett.cannon
Date: Sat May 10 04:24:33 2008
New Revision: 62966
Log:
Flesh out the transition plan for removing modules to cover what to do for
extension modules and to be more specific about doc changes.
Modified:
peps/trunk/pep-3108.txt
Modified: peps/trunk/pep-3108.txt
==============================================================================
--- peps/trunk/pep-3108.txt (original)
+++ peps/trunk/pep-3108.txt Sat May 10 04:24:33 2008
@@ -901,21 +901,32 @@
In Python 2.6
/////////////
-#. Add the following code to the deprecated module (adjusting the
+#. Add the following code to the deprecated module if it is
+ implemented in Python (adjusting the
module name and the ``warnings`` import and needed)::
from warnings import warnpy3k
warnpy3k("the XXX module has been removed in Python 3.0",
stacklevel=2)
del warnpy3k
+
+ or the following if it is an extension module::
+
+ if (PyErr_WarnPy3k("the XXX module has been removed in "
+ "Python 3.0", 2) < 0)
+ return;
(the Python-Dev TextMate bundle, available from ``Misc/TextMate``,
contains a command that will generate all of this for you).
#. Update the documentation. For modules with their own documentation
- file, use the ``:deprecated:`` option for the ``module`` directive
+ file, use the ``:deprecated:`` option with the ``module`` directive
along with the ``deprecated`` directive, stating the deprecation
- is occurring in 2.6, but is for the module's removal in 3.0.
+ is occurring in 2.6, but is for the module's removal in 3.0.::
+
+ .. deprecated:: 2.6
+ The XXX module has been removed in Python 3.0.
+
For modules simply listed in a file (e.g., ``undoc.rst``), use the
``warning`` directive.
More information about the Python-checkins
mailing list