[Python-3000-checkins] r66949 - in python/branches/py3k: Lib/test/test_sys.py Python/sysmodule.c

barry.warsaw python-3000-checkins at python.org
Fri Oct 17 03:29:56 CEST 2008


Author: barry.warsaw
Date: Fri Oct 17 03:29:56 2008
New Revision: 66949

Log:
Benjamin Peterson's patch to fix bug 3661, sys.call_tracing segfaults.


Modified:
   python/branches/py3k/Lib/test/test_sys.py
   python/branches/py3k/Python/sysmodule.c

Modified: python/branches/py3k/Lib/test/test_sys.py
==============================================================================
--- python/branches/py3k/Lib/test/test_sys.py	(original)
+++ python/branches/py3k/Lib/test/test_sys.py	Fri Oct 17 03:29:56 2008
@@ -166,6 +166,9 @@
             self.assert_(isinstance(v[3], int))
             self.assert_(isinstance(v[4], str))
 
+    def test_call_tracing(self):
+        self.assertRaises(TypeError, sys.call_tracing, type, 2)
+
     def test_dlopenflags(self):
         if hasattr(sys, "setdlopenflags"):
             self.assert_(hasattr(sys, "getdlopenflags"))

Modified: python/branches/py3k/Python/sysmodule.c
==============================================================================
--- python/branches/py3k/Python/sysmodule.c	(original)
+++ python/branches/py3k/Python/sysmodule.c	Fri Oct 17 03:29:56 2008
@@ -783,7 +783,7 @@
 sys_call_tracing(PyObject *self, PyObject *args)
 {
 	PyObject *func, *funcargs;
-	if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs))
+	if (!PyArg_ParseTuple(args, "OO!:call_tracing", &func, &PyTuple_Type, &funcargs))
 		return NULL;
 	return _PyEval_CallTracing(func, funcargs);
 }


More information about the Python-3000-checkins mailing list