fix bug in set args

This commit is contained in:
yukang 2023-04-27 00:32:01 +08:00
parent 589877cef1
commit 787f3fea15
2 changed files with 3 additions and 1 deletions

View File

@ -117,6 +117,8 @@ class GenerateAndParseConfig(unittest.TestCase):
self.assertNotEqual(build.config_toml.find("codegen-backends = ['cranelift']"), -1)
build = self.serialize_and_parse(["--set", "rust.codegen-backends=cranelift,llvm"])
self.assertNotEqual(build.config_toml.find("codegen-backends = ['cranelift', 'llvm']"), -1)
build = self.serialize_and_parse(["--enable-full-tools"])
self.assertNotEqual(build.config_toml.find("codegen-backends = ['llvm']"), -1)
if __name__ == '__main__':
SUITE = unittest.TestSuite()

View File

@ -299,7 +299,7 @@ def set(key, value, config):
parts = key.split('.')
for i, part in enumerate(parts):
if i == len(parts) - 1:
if is_value_list(part):
if is_value_list(part) and isinstance(value, str):
value = value.split(',')
arr[part] = value
else: