]> granicus.if.org Git - python/commitdiff
Deprecate the timing module for removal in Python 3.0.
authorBrett Cannon <bcannon@gmail.com>
Mon, 12 May 2008 03:47:47 +0000 (03:47 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 12 May 2008 03:47:47 +0000 (03:47 +0000)
Doc/library/undoc.rst
Misc/NEWS
Modules/timingmodule.c

index 981b0ce0cde863f766e4f9fe8978727a7ccc33aa..9875a071fffff0ba9938b116fac073bff51e30da 100644 (file)
@@ -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
index 4065c8b2540f5f9df6dd0b52d208b9199b510e81..06478338f07d18b070721c48bfc5bb2ea9ea7b07 100644 (file)
--- 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.
index 56e057a656a3aa2796a1ae03b72f733910b1aa11..0da5c6b763d771db7dcd276bbb3ae2075860d02e 100644 (file)
@@ -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);
 }