From e8055a56d265d558248557782fa3ed0e6419caa4 Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Fri, 14 Dec 2018 19:25:55 +0000 Subject: buildstream/utils.py: Fix regex Deprecation Warning Specify flags at the start of the expression as per the recommendation of the standard library. Without this patch, we currently get the following warning: ``` tests/examples/junctions.py::test_open_cross_junction_workspace /builds/BuildStream/buildstream/dist/buildstream/buildstream/utils.py:213: DeprecationWarning: Flags not at the start of the expression '\\/[^/]*\\Z(?ms)' regexer = re.compile(expression) ``` --- buildstream/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildstream/utils.py b/buildstream/utils.py index 4da29c259..a4600319b 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -1168,7 +1168,7 @@ def _call(*popenargs, terminate=False, **kwargs): # def _glob2re(pat): i, n = 0, len(pat) - res = '' + res = '(?ms)' while i < n: c = pat[i] i = i + 1 @@ -1205,7 +1205,7 @@ def _glob2re(pat): res = '{}[{}]'.format(res, stuff) else: res = res + re.escape(c) - return res + r'\Z(?ms)' + return res + r'\Z' # _deduplicate() -- cgit v1.2.1