mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Issue #7819: Check sys.call_tracing() arguments types.
py3k was already patched by issue #3661.
This commit is contained in:
		
							parent
							
								
									f3fa074703
								
							
						
					
					
						commit
						b4b0a2935d
					
				
					 3 changed files with 7 additions and 1 deletions
				
			
		| 
						 | 
					@ -433,6 +433,10 @@ def test_ioencoding(self):
 | 
				
			||||||
        out = p.communicate()[0].strip()
 | 
					        out = p.communicate()[0].strip()
 | 
				
			||||||
        self.assertEqual(out, '?')
 | 
					        self.assertEqual(out, '?')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_call_tracing(self):
 | 
				
			||||||
 | 
					        self.assertEqual(sys.call_tracing(str, (2,)), "2")
 | 
				
			||||||
 | 
					        self.assertRaises(TypeError, sys.call_tracing, str, 2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class SizeofTest(unittest.TestCase):
 | 
					class SizeofTest(unittest.TestCase):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 3?
 | 
				
			||||||
Core and Builtins
 | 
					Core and Builtins
 | 
				
			||||||
-----------------
 | 
					-----------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Issue #7819: Check sys.call_tracing() arguments types.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- Issue #7788: Fix an interpreter crash produced by deleting a list
 | 
					- Issue #7788: Fix an interpreter crash produced by deleting a list
 | 
				
			||||||
  slice with very large step value.
 | 
					  slice with very large step value.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -840,7 +840,7 @@ static PyObject *
 | 
				
			||||||
sys_call_tracing(PyObject *self, PyObject *args)
 | 
					sys_call_tracing(PyObject *self, PyObject *args)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	PyObject *func, *funcargs;
 | 
						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 NULL;
 | 
				
			||||||
	return _PyEval_CallTracing(func, funcargs);
 | 
						return _PyEval_CallTracing(func, funcargs);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue