mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Minor code nit: Move an unrelated statement out of a try clause in Sequence.index (GH-32330)
This commit is contained in:
		
							parent
							
								
									884eba3c76
								
							
						
					
					
						commit
						59a99ae277
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1022,10 +1022,10 @@ def index(self, value, start=0, stop=None):
 | 
			
		|||
        while stop is None or i < stop:
 | 
			
		||||
            try:
 | 
			
		||||
                v = self[i]
 | 
			
		||||
                if v is value or v == value:
 | 
			
		||||
                    return i
 | 
			
		||||
            except IndexError:
 | 
			
		||||
                break
 | 
			
		||||
            if v is value or v == value:
 | 
			
		||||
                return i
 | 
			
		||||
            i += 1
 | 
			
		||||
        raise ValueError
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue