mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Minor clarity edit to contextlib per Guido's request.
This commit is contained in:
		
							parent
							
								
									2ba96610bf
								
							
						
					
					
						commit
						93149d935d
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		|  | @ -31,11 +31,11 @@ def __exit__(self, type, value, traceback): | |||
|             try: | ||||
|                 self.gen.throw(type, value, traceback) | ||||
|                 raise RuntimeError("generator didn't stop after throw()") | ||||
|             except StopIteration: | ||||
|             except StopIteration, exc: | ||||
|                 # Suppress the exception *unless* it's the same exception that | ||||
|                 # was passed to throw().  This prevents a StopIteration | ||||
|                 # raised inside the "with" statement from being suppressed | ||||
|                 return sys.exc_info()[1] is not value | ||||
|                 return exc is not value | ||||
|             except: | ||||
|                 # only re-raise if it's *not* the exception that was | ||||
|                 # passed to throw(), because __exit__() must not raise | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Phillip J. Eby
						Phillip J. Eby