mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	#2358: add py3k warning to sys.exc_clear().
This commit is contained in:
		
							parent
							
								
									77354cf5ef
								
							
						
					
					
						commit
						5a44424c5e
					
				
					 3 changed files with 16 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -169,8 +169,16 @@ clause in the current stack frame or in an older stack frame."
 | 
			
		|||
static PyObject *
 | 
			
		||||
sys_exc_clear(PyObject *self, PyObject *noargs)
 | 
			
		||||
{
 | 
			
		||||
	PyThreadState *tstate = PyThreadState_GET();
 | 
			
		||||
	PyThreadState *tstate;
 | 
			
		||||
	PyObject *tmp_type, *tmp_value, *tmp_tb;
 | 
			
		||||
 | 
			
		||||
	if (Py_Py3kWarningFlag &&
 | 
			
		||||
	    PyErr_Warn(PyExc_DeprecationWarning,
 | 
			
		||||
		       "sys.exc_clear() not supported in 3.x. "
 | 
			
		||||
		       "Use except clauses.") < 0)
 | 
			
		||||
		return NULL;
 | 
			
		||||
 | 
			
		||||
	tstate = PyThreadState_GET();
 | 
			
		||||
	tmp_type = tstate->exc_type;
 | 
			
		||||
	tmp_value = tstate->exc_value;
 | 
			
		||||
	tmp_tb = tstate->exc_traceback;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue