always catch KeyboardInterrupt
Signed-off-by: Nico Schottelius <nico@kr.ethz.ch>
This commit is contained in:
		
					parent
					
						
							
								b4b354305c
							
						
					
				
			
			
				commit
				
					
						de7123df79
					
				
			
		
					 1 changed files with 8 additions and 8 deletions
				
			
		
							
								
								
									
										16
									
								
								bin/cdist
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								bin/cdist
									
										
									
									
									
								
							| 
						 | 
					@ -772,13 +772,13 @@ def commandline():
 | 
				
			||||||
         logging.root.setLevel(logging.DEBUG)
 | 
					         logging.root.setLevel(logging.DEBUG)
 | 
				
			||||||
   log.debug(args)
 | 
					   log.debug(args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   try:
 | 
					   args.func(args)
 | 
				
			||||||
      args.func(args)
 | 
					 | 
				
			||||||
   except KeyboardInterrupt:
 | 
					 | 
				
			||||||
       sys.exit(0)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
   if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])):
 | 
					   try:
 | 
				
			||||||
      emulator()
 | 
					      if re.match(TYPE_PREFIX, os.path.basename(sys.argv[0])):
 | 
				
			||||||
   else:
 | 
					         emulator()
 | 
				
			||||||
      commandline()
 | 
					      else:
 | 
				
			||||||
 | 
					         commandline()
 | 
				
			||||||
 | 
					   except KeyboardInterrupt:
 | 
				
			||||||
 | 
					       sys.exit(0)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue