Merge pull request #2186 from timgraham/escape-sequences-bytes

Fix "invalid escape sequence" bytestring warnings in Python 3.6
This commit is contained in:
wiredfool 2016-11-22 12:34:50 +00:00 committed by GitHub
commit d3cdaabf7c
3 changed files with 3 additions and 3 deletions

View File

@ -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")

View 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"

View File

@ -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]+"