From 1828dae78acf67c1e6ee0bc9de75ffb2412b0cb0 Mon Sep 17 00:00:00 2001 From: justvanrossum Date: Wed, 5 Dec 2018 12:46:36 +0100 Subject: [PATCH] Use raw strings for regex patterns. Fixes #1389 --- Lib/fontTools/ttLib/tables/ttProgram.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/fontTools/ttLib/tables/ttProgram.py b/Lib/fontTools/ttLib/tables/ttProgram.py index 62e0e1a74..7ffb37a02 100644 --- a/Lib/fontTools/ttLib/tables/ttProgram.py +++ b/Lib/fontTools/ttLib/tables/ttProgram.py @@ -159,7 +159,7 @@ def bitRepr(value, bits): return s -_mnemonicPat = re.compile("[A-Z][A-Z0-9]*$") +_mnemonicPat = re.compile(r"[A-Z][A-Z0-9]*$") def _makeDict(instructionList): opcodeDict = {} @@ -195,8 +195,8 @@ _whiteRE = re.compile(r"\s*") _pushCountPat = re.compile(r"[A-Z][A-Z0-9]*\s*\[.*?\]\s*/\* ([0-9]+).*?\*/") -_indentRE = re.compile("^FDEF|IF|ELSE\[ \]\t.+") -_unindentRE = re.compile("^ELSE|ENDF|EIF\[ \]\t.+") +_indentRE = re.compile(r"^FDEF|IF|ELSE\[ \]\t.+") +_unindentRE = re.compile(r"^ELSE|ENDF|EIF\[ \]\t.+") def _skipWhite(data, pos): m = _whiteRE.match(data, pos)