[Python-checkins] r76193 - sandbox/trunk/newgil/Python/sysmodule.c

antoine.pitrou python-checkins at python.org
Tue Nov 10 20:34:21 CET 2009


Author: antoine.pitrou
Date: Tue Nov 10 20:34:20 2009
New Revision: 76193

Log:
Since sys.{get,set}checkinterval() are now no-ops, deprecate them.



Modified:
   sandbox/trunk/newgil/Python/sysmodule.c

Modified: sandbox/trunk/newgil/Python/sysmodule.c
==============================================================================
--- sandbox/trunk/newgil/Python/sysmodule.c	(original)
+++ sandbox/trunk/newgil/Python/sysmodule.c	Tue Nov 10 20:34:20 2009
@@ -454,6 +454,11 @@
 static PyObject *
 sys_setcheckinterval(PyObject *self, PyObject *args)
 {
+	if (PyErr_WarnEx(PyExc_DeprecationWarning,
+			 "sys.getcheckinterval() and sys.setcheckinterval() "
+			 "are deprecated.  Use sys.setswitchinterval() "
+			 "instead.", 1) < 0)
+		return NULL;
 	if (!PyArg_ParseTuple(args, "i:setcheckinterval", &_check_interval))
 		return NULL;
 	Py_INCREF(Py_None);
@@ -470,6 +475,11 @@
 static PyObject *
 sys_getcheckinterval(PyObject *self, PyObject *args)
 {
+	if (PyErr_WarnEx(PyExc_DeprecationWarning,
+			 "sys.getcheckinterval() and sys.setcheckinterval() "
+			 "are deprecated.  Use sys.getswitchinterval() "
+			 "instead.", 1) < 0)
+		return NULL;
 	return PyLong_FromLong(_check_interval);
 }
 


More information about the Python-checkins mailing list