diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-14 15:49:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-16 15:35:07 +0000 |
commit | cd4b8a8553f9d551af27941910cf4d3405ecb7b0 (patch) | |
tree | 4f2c58eca95fd5ea9a4538a66a4875fd9d947b0d /meta/lib/oe/license.py | |
parent | 1ee53881eea3a7ca4d4f6a5ca9c4c6e6488d2348 (diff) | |
download | poky-cd4b8a8553f9d551af27941910cf4d3405ecb7b0.tar.gz |
meta: Fix Deprecated warnings from regexs
Fix handling of escape characters in regexs and hence fix python
Deprecation warnings which will be problematic in python 3.8.
Note that some show up as:
"""
meta/classes/package.bbclass:1293: DeprecationWarning: invalid escape sequence \.
"""
where the problem isn't on 1293 in package.bbclass but in some _prepend to a
package.bbclass function in a different file like mesa.inc, often from
do_package_split() calls.
(From OE-Core rev: 4b1c0c7d5525fc4cea9e0f02ec54e92a6fbc6199)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe/license.py')
-rw-r--r-- | meta/lib/oe/license.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/lib/oe/license.py b/meta/lib/oe/license.py index ca385d5187..04f5b316a9 100644 --- a/meta/lib/oe/license.py +++ b/meta/lib/oe/license.py | |||
@@ -13,8 +13,8 @@ def license_ok(license, dont_want_licenses): | |||
13 | # will exclude a trailing '+' character from LICENSE in | 13 | # will exclude a trailing '+' character from LICENSE in |
14 | # case INCOMPATIBLE_LICENSE is not a 'X+' license. | 14 | # case INCOMPATIBLE_LICENSE is not a 'X+' license. |
15 | lic = license | 15 | lic = license |
16 | if not re.search('\+$', dwl): | 16 | if not re.search(r'\+$', dwl): |
17 | lic = re.sub('\+', '', license) | 17 | lic = re.sub(r'\+', '', license) |
18 | if fnmatch(lic, dwl): | 18 | if fnmatch(lic, dwl): |
19 | return False | 19 | return False |
20 | return True | 20 | return True |
@@ -40,8 +40,8 @@ class InvalidLicense(LicenseError): | |||
40 | return "invalid characters in license '%s'" % self.license | 40 | return "invalid characters in license '%s'" % self.license |
41 | 41 | ||
42 | license_operator_chars = '&|() ' | 42 | license_operator_chars = '&|() ' |
43 | license_operator = re.compile('([' + license_operator_chars + '])') | 43 | license_operator = re.compile(r'([' + license_operator_chars + '])') |
44 | license_pattern = re.compile('[a-zA-Z0-9.+_\-]+$') | 44 | license_pattern = re.compile(r'[a-zA-Z0-9.+_\-]+$') |
45 | 45 | ||
46 | class LicenseVisitor(ast.NodeVisitor): | 46 | class LicenseVisitor(ast.NodeVisitor): |
47 | """Get elements based on OpenEmbedded license strings""" | 47 | """Get elements based on OpenEmbedded license strings""" |