mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	bpo-43270: Remove private _PyErr_OCCURRED() macro (GH-24579)
Remove the private _PyErr_OCCURRED() macro: use the public PyErr_Occurred() function instead. CPython internals must use the internal _PyErr_Occurred(tstate) function instead: it is the most efficient way to check if an exception was raised.
This commit is contained in:
		
							parent
							
								
									acde3f1530
								
							
						
					
					
						commit
						a486054b24
					
				
					 3 changed files with 3 additions and 7 deletions
				
			
		|  | @ -2750,7 +2750,7 @@ _PyEval_EvalFrameDefault(PyThreadState *tstate, PyFrameObject *f, int throwflag) | |||
|                                        (PyDictObject *)f->f_builtins, | ||||
|                                        name); | ||||
|                 if (v == NULL) { | ||||
|                     if (!_PyErr_OCCURRED()) { | ||||
|                     if (!_PyErr_Occurred(tstate)) { | ||||
|                         /* _PyDict_LoadGlobal() returns NULL without raising
 | ||||
|                          * an exception if the key doesn't exist */ | ||||
|                         format_exc_check_arg(tstate, PyExc_NameError, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Victor Stinner
						Victor Stinner