mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-14 19:36:38 +03:00
Merge pull request #2186 from timgraham/escape-sequences-bytes
Fix "invalid escape sequence" bytestring warnings in Python 3.6
This commit is contained in:
commit
d3cdaabf7c
|
@ -41,7 +41,7 @@ class GimpPaletteFile(object):
|
|||
if not s:
|
||||
break
|
||||
# skip fields and comment lines
|
||||
if re.match(b"\w+:|#", s):
|
||||
if re.match(br"\w+:|#", s):
|
||||
continue
|
||||
if len(s) > 100:
|
||||
raise SyntaxError("bad palette file")
|
||||
|
|
|
@ -48,7 +48,7 @@ i8 = _binary.i8
|
|||
i16 = _binary.i16be
|
||||
i32 = _binary.i32be
|
||||
|
||||
is_cid = re.compile(b"\w\w\w\w").match
|
||||
is_cid = re.compile(br"\w\w\w\w").match
|
||||
|
||||
|
||||
_MAGIC = b"\211PNG\r\n\032\n"
|
||||
|
|
|
@ -26,7 +26,7 @@ __version__ = "0.6"
|
|||
|
||||
# XBM header
|
||||
xbm_head = re.compile(
|
||||
b"\s*#define[ \t]+.*_width[ \t]+(?P<width>[0-9]+)[\r\n]+"
|
||||
br"\s*#define[ \t]+.*_width[ \t]+(?P<width>[0-9]+)[\r\n]+"
|
||||
b"#define[ \t]+.*_height[ \t]+(?P<height>[0-9]+)[\r\n]+"
|
||||
b"(?P<hotspot>"
|
||||
b"#define[ \t]+[^_]*_x_hot[ \t]+(?P<xhot>[0-9]+)[\r\n]+"
|
||||
|
|
Loading…
Reference in New Issue
Block a user