mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 05:31:20 +00:00 
			
		
		
		
	Remove a bare try/except completely -- it just did not make sense!
Add a comment elsewhere making clear an assumption in the code.
This commit is contained in:
		
							parent
							
								
									e8187615e2
								
							
						
					
					
						commit
						6f6a14f888
					
				
					 1 changed files with 12 additions and 12 deletions
				
			
		|  | @ -113,7 +113,6 @@ def add_label_data(self, format, counter, blankline = None): | |||
|     def format_counter(self, format, counter): | ||||
|         label = '' | ||||
|         for c in format: | ||||
|             try: | ||||
|             if c == '1': | ||||
|                 label = label + ('%d' % counter) | ||||
|             elif c in 'aA': | ||||
|  | @ -124,14 +123,15 @@ def format_counter(self, format, counter): | |||
|                     label = label + self.format_roman(c, counter) | ||||
|             else: | ||||
|                 label = label + c | ||||
|             except: | ||||
|                 label = label + c | ||||
|         return label | ||||
| 
 | ||||
|     def format_letter(self, case, counter): | ||||
|         label = '' | ||||
|         while counter > 0: | ||||
|             counter, x = divmod(counter-1, 26) | ||||
|             # This makes a strong assumption that lowercase letters | ||||
|             # and uppercase letters form two contiguous blocks, with | ||||
|             # letters in order! | ||||
|             s = chr(ord(case) + x) | ||||
|             label = s + label | ||||
|         return label | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Fred Drake
						Fred Drake