mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Merge pull request #4121 from jdufresne/bytes
Use bytes literals instead of bytes(str)
This commit is contained in:
		
						commit
						fe855ab999
					
				| 
						 | 
				
			
			@ -4,9 +4,5 @@
 | 
			
		|||
from io import BytesIO
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
from PIL._util import py3
 | 
			
		||||
 | 
			
		||||
if py3:
 | 
			
		||||
    Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00", "latin-1")))
 | 
			
		||||
else:
 | 
			
		||||
    Image.open(BytesIO(bytes("icns\x00\x00\x00\x10hang\x00\x00\x00\x00")))
 | 
			
		||||
Image.open(BytesIO(b"icns\x00\x00\x00\x10hang\x00\x00\x00\x00"))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -4,19 +4,5 @@
 | 
			
		|||
from io import BytesIO
 | 
			
		||||
 | 
			
		||||
from PIL import Image
 | 
			
		||||
from PIL._util import py3
 | 
			
		||||
 | 
			
		||||
if py3:
 | 
			
		||||
    Image.open(
 | 
			
		||||
        BytesIO(
 | 
			
		||||
            bytes(
 | 
			
		||||
                "\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang",
 | 
			
		||||
                "latin-1",
 | 
			
		||||
            )
 | 
			
		||||
        )
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
else:
 | 
			
		||||
    Image.open(
 | 
			
		||||
        BytesIO(bytes("\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang"))
 | 
			
		||||
    )
 | 
			
		||||
Image.open(BytesIO(b"\x00\x00\x00\x0cjP\x20\x20\x0d\x0a\x87\x0a\x00\x00\x00\x00hang"))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user