mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	In unconditional except clauses, don't catch KeyboardInterrupt -- it's
annoying that often you have to hit ^C numerous times before it works. The solution: before the "except:" clause, insert "except KeyboardInterrupt: raise". This propagates KeyboardInterrupt out, stopping the test in its tracks.
This commit is contained in:
		
							parent
							
								
									eb4b7bad33
								
							
						
					
					
						commit
						202dd1ef42
					
				
					 1 changed files with 6 additions and 0 deletions
				
			
		|  | @ -202,6 +202,8 @@ def __call__(self, result=None): | |||
|         try: | ||||
|             try: | ||||
|                 self.setUp() | ||||
|             except KeyboardInterrupt: | ||||
|                 raise | ||||
|             except: | ||||
|                 result.addError(self, self.__exc_info()) | ||||
|                 return | ||||
|  | @ -212,11 +214,15 @@ def __call__(self, result=None): | |||
|                 ok = 1 | ||||
|             except self.failureException, e: | ||||
|                 result.addFailure(self, self.__exc_info()) | ||||
|             except KeyboardInterrupt: | ||||
|                 raise | ||||
|             except: | ||||
|                 result.addError(self, self.__exc_info()) | ||||
| 
 | ||||
|             try: | ||||
|                 self.tearDown() | ||||
|             except KeyboardInterrupt: | ||||
|                 raise | ||||
|             except: | ||||
|                 result.addError(self, self.__exc_info()) | ||||
|                 ok = 0 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum