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:
parent
cb1cd53576
commit
fded256bde
17
pep-3108.txt
17
pep-3108.txt
|
@ -901,7 +901,8 @@ In Python 3.0
|
|||
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
|
||||
|
@ -909,13 +910,23 @@ In Python 2.6
|
|||
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.
|
||||
|
||||
|
|
Loading…
Reference in New Issue