mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	bpo-38410: Properly handle PySys_Audit() failures (GH-16657)
This commit is contained in:
		
							parent
							
								
									62d21c9d90
								
							
						
					
					
						commit
						79ceccd1ec
					
				
					 4 changed files with 20 additions and 12 deletions
				
			
		|  | @ -1222,10 +1222,12 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) | |||
|                           Py_TYPE(finalizer)->tp_name); | ||||
|             return NULL; | ||||
|         } | ||||
|         _PyEval_SetAsyncGenFinalizer(finalizer); | ||||
|         if (_PyEval_SetAsyncGenFinalizer(finalizer) < 0) { | ||||
|             return NULL; | ||||
|         } | ||||
|     } | ||||
|     else if (finalizer == Py_None) { | ||||
|         _PyEval_SetAsyncGenFinalizer(NULL); | ||||
|     else if (finalizer == Py_None && _PyEval_SetAsyncGenFinalizer(NULL) < 0) { | ||||
|         return NULL; | ||||
|     } | ||||
| 
 | ||||
|     if (firstiter && firstiter != Py_None) { | ||||
|  | @ -1235,10 +1237,12 @@ sys_set_asyncgen_hooks(PyObject *self, PyObject *args, PyObject *kw) | |||
|                           Py_TYPE(firstiter)->tp_name); | ||||
|             return NULL; | ||||
|         } | ||||
|         _PyEval_SetAsyncGenFirstiter(firstiter); | ||||
|         if (_PyEval_SetAsyncGenFirstiter(firstiter) < 0) { | ||||
|             return NULL; | ||||
|         } | ||||
|     } | ||||
|     else if (firstiter == Py_None) { | ||||
|         _PyEval_SetAsyncGenFirstiter(NULL); | ||||
|     else if (firstiter == Py_None && _PyEval_SetAsyncGenFirstiter(NULL) < 0) { | ||||
|         return NULL; | ||||
|     } | ||||
| 
 | ||||
|     Py_RETURN_NONE; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zackery Spytz
						Zackery Spytz