mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 21:51:50 +00:00 
			
		
		
		
	Fix resource warning found manually
This commit is contained in:
		
							parent
							
								
									a0b3c32c7a
								
							
						
					
					
						commit
						dcb22a3936
					
				
					 1 changed files with 13 additions and 10 deletions
				
			
		|  | @ -294,6 +294,7 @@ def read_template(self): | |||
|                             join_lines=1, lstrip_ws=1, rstrip_ws=1, | ||||
|                             collapse_join=1) | ||||
| 
 | ||||
|         try: | ||||
|             while True: | ||||
|                 line = template.readline() | ||||
|                 if line is None:            # end of file | ||||
|  | @ -305,6 +306,8 @@ def read_template(self): | |||
|                     self.warn("%s, line %d: %s" % (template.filename, | ||||
|                                                    template.current_line, | ||||
|                                                    msg)) | ||||
|         finally: | ||||
|             template.close() | ||||
| 
 | ||||
|     def prune_file_list(self): | ||||
|         """Prune off branches that might slip into the file list as created | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Éric Araujo
						Éric Araujo