diff options
author | Sean McGinnis <sean.mcginnis@gmail.com> | 2019-04-09 15:53:49 -0500 |
---|---|---|
committer | Sean McGinnis <sean.mcginnis@gmail.com> | 2019-04-09 15:53:49 -0500 |
commit | b882c312465c311dfde059d6266efca2a43ec8e0 (patch) | |
tree | 1db788bac36c49884ba8fc96047e710ff20e2f81 | |
parent | ee2c228dd2b47c4946bb0bfa375336fd06ae575e (diff) | |
download | oslo-log-b882c312465c311dfde059d6266efca2a43ec8e0.tar.gz |
Use raw string for regex
Special characters in regular strings now cause DeprecationWarnings
starting with Python 3.6. This frequently happens with regex strings.
Oslo.log had one instance of a regex string containing '\' that would
cause deprecation warnings in logs. This switches that instance over to
be a raw string to avoid these warnings.
Change-Id: Ia5637f35315127c5cc46e01f5e38eccb094e772d
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
-rw-r--r-- | oslo_log/formatters.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/oslo_log/formatters.py b/oslo_log/formatters.py index 8386ccc..bc0a6e1 100644 --- a/oslo_log/formatters.py +++ b/oslo_log/formatters.py @@ -181,7 +181,7 @@ class _ReplaceFalseValue(dict): return dict.get(self, key, None) or '-' -_MSG_KEY_REGEX = re.compile('(%+)\((\w+)\)') +_MSG_KEY_REGEX = re.compile(r'(%+)\((\w+)\)') class JSONFormatter(logging.Formatter): |