aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-01-21 10:50:10 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-01-21 11:39:46 +0000
commit7662f8c8676d87cb318f811423cc02fe8cb146f6 (patch)
treeb07738644bf1ff634325b79fcbd712a95928f253
parent9861ed37bb1c5d09c3b4852d2a252e3f3c86ab14 (diff)
downloadbitbake-7662f8c8676d87cb318f811423cc02fe8cb146f6.tar.gz
fetch2: handle empty elements in _param_str_split
_param_str_split is used to split ?foo=1;bar=2 into a dictionary, but throws an exception if a lone semicolon is used as the value doesn't split into two items. Fix by checking that the result of the first split has content. Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/__init__.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py
index 07b7ae41b..ee3d7b167 100644
--- a/lib/bb/fetch2/__init__.py
+++ b/lib/bb/fetch2/__init__.py
@@ -290,7 +290,7 @@ class URI(object):
def _param_str_split(self, string, elmdelim, kvdelim="="):
ret = collections.OrderedDict()
- for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim)]:
+ for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim) if x]:
ret[k] = v
return ret