barry.warsaw
2008-10-17 01:29:56 UTC
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);
}
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);
}