From: Brett Cannon Date: Mon, 12 May 2008 03:47:47 +0000 (+0000) Subject: Deprecate the timing module for removal in Python 3.0. X-Git-Tag: v2.6b1~465 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bb141bb1f4ece144f681739279dba266f5e64a9d;p=python Deprecate the timing module for removal in Python 3.0. --- diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst index 981b0ce0cd..9875a071ff 100644 --- a/Doc/library/undoc.rst +++ b/Doc/library/undoc.rst @@ -213,6 +213,8 @@ extensions. :mod:`timing` --- Measure time intervals to high resolution (use :func:`time.clock` instead). + + .. warning:: The :mod:`timing` module has been removed in Python 3.0. SGI-specific Extension modules diff --git a/Misc/NEWS b/Misc/NEWS index 4065c8b254..06478338f0 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -26,6 +26,8 @@ Extension Modules Library ------- +- The timing module has been deprecated for removal in Python 3.0. + - The sv module has been deprecated for removal in Python 3.0. - The multifile module has been deprecated as per PEP 4. diff --git a/Modules/timingmodule.c b/Modules/timingmodule.c index 56e057a656..0da5c6b763 100644 --- a/Modules/timingmodule.c +++ b/Modules/timingmodule.c @@ -54,5 +54,9 @@ static PyMethodDef timing_methods[] = { PyMODINIT_FUNC inittiming(void) { + if (PyErr_WarnPy3k("the timing module has been removed in " + "Python 3.0; use time.clock() instead", 2) < 0) + return; + (void)Py_InitModule("timing", timing_methods); }