summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-13 22:46:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-11-14 11:18:18 +0000
commit490bca81c31983a95854bd6970f7ac0edb5a3955 (patch)
treed34dffd937cb222cc750e6faf5b142123f264cc8
parent54bbe35eab3e8f3618024ca8d1b30ff1c425201f (diff)
downloadpoky-490bca81c31983a95854bd6970f7ac0edb5a3955.tar.gz
bitbake: utils: Avoid regex value escape warnings
Avoid warnings such as: bitbake/lib/bb/utils.py:72: DeprecationWarning: invalid escape sequence \d numeric_regexp = re.compile('^(\d+)(.*)$') bitbake/lib/bb/utils.py:1165: DeprecationWarning: invalid escape sequence \( var_res[var] = re.compile('^(%s%s)[ \\t]*\([ \\t]*\)[ \\t]*{' % (var[:-2].rstrip(), override_re)) (Bitbake rev: bbf3cbae775383265292a778cd522d4e2f69a3a0) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/utils.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 461122bba1..3b0c9599c4 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -69,8 +69,8 @@ class VersionStringException(Exception):
69 69
70def explode_version(s): 70def explode_version(s):
71 r = [] 71 r = []
72 alpha_regexp = re.compile('^([a-zA-Z]+)(.*)$') 72 alpha_regexp = re.compile(r'^([a-zA-Z]+)(.*)$')
73 numeric_regexp = re.compile('^(\d+)(.*)$') 73 numeric_regexp = re.compile(r'^(\d+)(.*)$')
74 while (s != ''): 74 while (s != ''):
75 if s[0] in string.digits: 75 if s[0] in string.digits:
76 m = numeric_regexp.match(s) 76 m = numeric_regexp.match(s)
@@ -1158,14 +1158,14 @@ def edit_metadata(meta_lines, variables, varfunc, match_overrides=False):
1158 1158
1159 var_res = {} 1159 var_res = {}
1160 if match_overrides: 1160 if match_overrides:
1161 override_re = '(_[a-zA-Z0-9-_$(){}]+)?' 1161 override_re = r'(_[a-zA-Z0-9-_$(){}]+)?'
1162 else: 1162 else:
1163 override_re = '' 1163 override_re = ''
1164 for var in variables: 1164 for var in variables:
1165 if var.endswith('()'): 1165 if var.endswith('()'):
1166 var_res[var] = re.compile('^(%s%s)[ \\t]*\([ \\t]*\)[ \\t]*{' % (var[:-2].rstrip(), override_re)) 1166 var_res[var] = re.compile(r'^(%s%s)[ \\t]*\([ \\t]*\)[ \\t]*{' % (var[:-2].rstrip(), override_re))
1167 else: 1167 else:
1168 var_res[var] = re.compile('^(%s%s)[ \\t]*[?+:.]*=[+.]*[ \\t]*(["\'])' % (var, override_re)) 1168 var_res[var] = re.compile(r'^(%s%s)[ \\t]*[?+:.]*=[+.]*[ \\t]*(["\'])' % (var, override_re))
1169 1169
1170 updated = False 1170 updated = False
1171 varset_start = '' 1171 varset_start = ''