diff options
author | Ross Burton <ross@burtonini.com> | 2021-01-21 10:50:10 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-01-21 23:25:53 +0000 |
commit | 3b645e0d08f91b6d4929072d16a47ba3302821c9 (patch) | |
tree | 5795ac6821c592a67ea78aa277bbdd7fa63467f5 | |
parent | ae72a0336abafefefe5c01e20581f10df9d5319f (diff) | |
download | poky-3b645e0d08f91b6d4929072d16a47ba3302821c9.tar.gz |
bitbake: 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.
(Bitbake rev: 7662f8c8676d87cb318f811423cc02fe8cb146f6)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/fetch2/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/__init__.py b/bitbake/lib/bb/fetch2/__init__.py index 07b7ae41b4..ee3d7b1672 100644 --- a/bitbake/lib/bb/fetch2/__init__.py +++ b/bitbake/lib/bb/fetch2/__init__.py | |||
@@ -290,7 +290,7 @@ class URI(object): | |||
290 | 290 | ||
291 | def _param_str_split(self, string, elmdelim, kvdelim="="): | 291 | def _param_str_split(self, string, elmdelim, kvdelim="="): |
292 | ret = collections.OrderedDict() | 292 | ret = collections.OrderedDict() |
293 | for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim)]: | 293 | for k, v in [x.split(kvdelim, 1) for x in string.split(elmdelim) if x]: |
294 | ret[k] = v | 294 | ret[k] = v |
295 | return ret | 295 | return ret |
296 | 296 | ||