mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Changed int conversion in ImagePalette to ord for Python 2
This commit is contained in:
		
							parent
							
								
									15586c5b59
								
							
						
					
					
						commit
						4f6f5f9182
					
				| 
						 | 
				
			
			@ -98,7 +98,8 @@ class ImagePalette(object):
 | 
			
		|||
            except KeyError:
 | 
			
		||||
                # allocate new color slot
 | 
			
		||||
                if isinstance(self.palette, bytes):
 | 
			
		||||
                    self.palette = [int(x) for x in self.palette]
 | 
			
		||||
                    self.palette = [(ord(x) if str is bytes else int(x))
 | 
			
		||||
                                    for x in self.palette]
 | 
			
		||||
                index = len(self.colors)
 | 
			
		||||
                if index >= 256:
 | 
			
		||||
                    raise ValueError("cannot allocate more than 256 colors")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user