Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d85f1c0

Browse files
author
Victor Stinner
committed
Merged revisions 77892 via svnmerge from
svn+ssh://[email protected]/python/trunk ........ r77892 | victor.stinner | 2010-01-31 23:32:15 +0100 (dim., 31 janv. 2010) | 4 lines Issue python#7819: Check sys.call_tracing() arguments types. py3k was already patched by issue python#3661. ........
1 parent 22697c0 commit d85f1c0

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lib/test/test_sys.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ def test_ioencoding(self):
391391
out = p.stdout.read().strip()
392392
self.assertEqual(out, '?')
393393

394+
def test_call_tracing(self):
395+
self.assertEqual(sys.call_tracing(str, (2,)), "2")
396+
self.assertRaises(TypeError, sys.call_tracing, str, 2)
397+
394398

395399
class SizeofTest(unittest.TestCase):
396400

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 2.6.5
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #7819: Check sys.call_tracing() arguments types.
16+
1517
- Issue #7788: Fix an interpreter crash produced by deleting a list
1618
slice with very large step value.
1719

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ static PyObject *
802802
sys_call_tracing(PyObject *self, PyObject *args)
803803
{
804804
PyObject *func, *funcargs;
805-
if (!PyArg_UnpackTuple(args, "call_tracing", 2, 2, &func, &funcargs))
805+
if (!PyArg_ParseTuple(args, "OO!:call_tracing", &func, &PyTuple_Type, &funcargs))
806806
return NULL;
807807
return _PyEval_CallTracing(func, funcargs);
808808
}

0 commit comments

Comments
 (0)