[Notes] [Git][BuildStream/buildstream][tpollard/fixbuildtreereq] 4 commits: tests/frontend/logging.py: Fix regex Deprecation Warning



Title: GitLab

Tom Pollard pushed to branch tpollard/fixbuildtreereq at BuildStream / buildstream

Commits:

3 changed files:

Changes:

  • buildstream/_stream.py
    ... ... @@ -1263,7 +1263,7 @@ class Stream():
    1263 1263
             required_list = []
    
    1264 1264
     
    
    1265 1265
             # If context is set to not pull buildtrees, or no fetch remotes, return empty list
    
    1266
    -        if not (self._context.pull_buildtrees or self._artifacts.has_fetch_remotes()):
    
    1266
    +        if not self._context.pull_buildtrees or not self._artifacts.has_fetch_remotes():
    
    1267 1267
                 return required_list
    
    1268 1268
     
    
    1269 1269
             for element in elements:
    

  • buildstream/utils.py
    ... ... @@ -1168,7 +1168,7 @@ def _call(*popenargs, terminate=False, **kwargs):
    1168 1168
     #
    
    1169 1169
     def _glob2re(pat):
    
    1170 1170
         i, n = 0, len(pat)
    
    1171
    -    res = ''
    
    1171
    +    res = '(?ms)'
    
    1172 1172
         while i < n:
    
    1173 1173
             c = pat[i]
    
    1174 1174
             i = i + 1
    
    ... ... @@ -1205,7 +1205,7 @@ def _glob2re(pat):
    1205 1205
                     res = '{}[{}]'.format(res, stuff)
    
    1206 1206
             else:
    
    1207 1207
                 res = res + re.escape(c)
    
    1208
    -    return res + r'\Z(?ms)'
    
    1208
    +    return res + r'\Z'
    
    1209 1209
     
    
    1210 1210
     
    
    1211 1211
     # _deduplicate()
    

  • tests/frontend/logging.py
    ... ... @@ -41,7 +41,7 @@ def test_default_logging(cli, tmpdir, datafiles):
    41 41
         result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    42 42
         result.assert_success()
    
    43 43
     
    
    44
    -    m = re.search("\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
    
    44
    +    m = re.search(r"\[\d\d:\d\d:\d\d\]\[\]\[\] SUCCESS Checking sources", result.stderr)
    
    45 45
         assert(m is not None)
    
    46 46
     
    
    47 47
     
    
    ... ... @@ -77,7 +77,7 @@ def test_custom_logging(cli, tmpdir, datafiles):
    77 77
         result = cli.run(project=project, args=['source', 'fetch', element_name])
    
    78 78
         result.assert_success()
    
    79 79
     
    
    80
    -    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)
    
    80
    +    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)
    
    81 81
         assert(m is not None)
    
    82 82
     
    
    83 83
     
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]