Flesh out the transition plan for removing modules to cover what to do for

extension modules and to be more specific about doc changes.
This commit is contained in:
Brett Cannon 2008-05-10 02:24:33 +00:00
parent cb1cd53576
commit fded256bde
1 changed files with 14 additions and 3 deletions

View File

@ -901,7 +901,8 @@ In Python 3.0
In Python 2.6 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):: module name and the ``warnings`` import and needed)::
from warnings import warnpy3k from warnings import warnpy3k
@ -909,13 +910,23 @@ In Python 2.6
stacklevel=2) stacklevel=2)
del warnpy3k 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``, (the Python-Dev TextMate bundle, available from ``Misc/TextMate``,
contains a command that will generate all of this for you). contains a command that will generate all of this for you).
#. Update the documentation. For modules with their own documentation #. 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 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 For modules simply listed in a file (e.g., ``undoc.rst``), use the
``warning`` directive. ``warning`` directive.