From d62d6e029dd9422e57e2f0371ff5bb85f752d492 Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Wed, 16 Aug 2017 16:40:36 -0400 Subject: [PATCH] Fix python 3.6 escape char warnings in strings In python 3.6, escape sequences that are not recognized in string literals issue DeprecationWarnings. Convert these to raw strings. Change-Id: I0e2bff9cb45974b159aed6a63913a63b1956aa32 --- hacking/checks/localization.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hacking/checks/localization.py b/hacking/checks/localization.py index 79335a9e..429ff093 100644 --- a/hacking/checks/localization.py +++ b/hacking/checks/localization.py @@ -16,14 +16,14 @@ import tokenize from hacking import core -FORMAT_RE = re.compile("%(?:" - "%|" # Ignore plain percents - "(\(\w+\))?" # mapping key - "([#0 +-]?" # flag - "(?:\d+|\*)?" # width - "(?:\.\d+)?" # precision - "[hlL]?" # length mod - "\w))") # type +FORMAT_RE = re.compile(r"%(?:" + r"%|" # Ignore plain percents + r"(\(\w+\))?" # mapping key + r"([#0 +-]?" # flag + r"(?:\d+|\*)?" # width + r"(?:\.\d+)?" # precision + r"[hlL]?" # length mod + r"\w))") # type class LocalizationError(Exception):