summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2018-12-20 16:34:08 +0000
committerChandan Singh <chandan@chandansingh.net>2018-12-20 16:34:08 +0000
commitcd4889af3efc4a1f6bb5572b9987ac0805fc60d1 (patch)
treefa91345c1c918336d656c6a6f4a888a2b372f0cd
parente0c575c453dbc379e04ff0694d15c836223e5850 (diff)
parente8055a56d265d558248557782fa3ed0e6419caa4 (diff)
downloadbuildstream-cd4889af3efc4a1f6bb5572b9987ac0805fc60d1.tar.gz
Merge branch 'chandan/fix-warning' into 'master'
Fix Deprecation warnings from regex module See merge request BuildStream/buildstream!1010
-rw-r--r--buildstream/utils.py4
-rw-r--r--tests/frontend/logging.py4
2 files changed, 4 insertions, 4 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()
diff --git a/tests/frontend/logging.py b/tests/frontend/logging.py
index be4b4213b..a10f62cc1 100644
--- a/tests/frontend/logging.py
+++ b/tests/frontend/logging.py
@@ -41,7 +41,7 @@ def test_default_logging(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
- m = re.search("\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
+ m = re.search(r"\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
assert(m is not None)
@@ -77,7 +77,7 @@ def test_custom_logging(cli, tmpdir, datafiles):
result = cli.run(project=project, args=['source', 'fetch', element_name])
result.assert_success()
- m = re.search("\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr)
+ m = re.search(r"\d\d:\d\d:\d\d,\d\d:\d\d:\d\d.\d{6},\d\d:\d\d:\d\d,,,SUCCESS,Checking sources", result.stderr)
assert(m is not None)