diff --git a/PIL/GimpPaletteFile.py b/PIL/GimpPaletteFile.py index 4bf3ca36a..e4b4641e5 100644 --- a/PIL/GimpPaletteFile.py +++ b/PIL/GimpPaletteFile.py @@ -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") diff --git a/PIL/PngImagePlugin.py b/PIL/PngImagePlugin.py index a5f4c3f42..4d6f9d7ff 100644 --- a/PIL/PngImagePlugin.py +++ b/PIL/PngImagePlugin.py @@ -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" diff --git a/PIL/XbmImagePlugin.py b/PIL/XbmImagePlugin.py index bca882866..d0b0e47ab 100644 --- a/PIL/XbmImagePlugin.py +++ b/PIL/XbmImagePlugin.py @@ -26,7 +26,7 @@ __version__ = "0.6" # XBM header xbm_head = re.compile( - b"\s*#define[ \t]+.*_width[ \t]+(?P[0-9]+)[\r\n]+" + br"\s*#define[ \t]+.*_width[ \t]+(?P[0-9]+)[\r\n]+" b"#define[ \t]+.*_height[ \t]+(?P[0-9]+)[\r\n]+" b"(?P" b"#define[ \t]+[^_]*_x_hot[ \t]+(?P[0-9]+)[\r\n]+"