Skip to content

Commit

Permalink
Merge pull request #4121 from jdufresne/bytes
Browse files Browse the repository at this point in the history
Use bytes literals instead of bytes(str)
  • Loading branch information
hugovk committed Oct 7, 2019
2 parents bbfa8bc + 922f55c commit fe855ab
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
6 changes: 1 addition & 5 deletions Tests/check_icns_dos.py
Expand Up @@ -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"))
16 changes: 1 addition & 15 deletions Tests/check_j2k_dos.py
Expand Up @@ -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"))

0 comments on commit fe855ab

Please sign in to comment.