From 02f12f41b031a1c2672e7cf1cb8ebde58288c547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Thu, 23 Feb 2012 21:14:18 +0100 Subject: gsettings-schema-convert: Don't fail to convert lists without default element --- gsettings/gsettings-schema-convert | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gsettings') diff --git a/gsettings/gsettings-schema-convert b/gsettings/gsettings-schema-convert index a60dc35f..913cc83b 100755 --- a/gsettings/gsettings-schema-convert +++ b/gsettings/gsettings-schema-convert @@ -854,11 +854,10 @@ class GConfSchema: # Fix the default value to be parsable by GVariant if self.type == 'list': l = self.default.strip() - if not (l[0] == '[' and l[-1] == ']'): - if not l: - l = '[]' - else: - raise GSettingsSchemaConvertException('Cannot parse default list value \'%s\' for key \'%s\'.' % (self.default, self.applyto or self.key)) + if not l: + l = '[]' + elif not (l[0] == '[' and l[-1] == ']'): + raise GSettingsSchemaConvertException('Cannot parse default list value \'%s\' for key \'%s\'.' % (self.default, self.applyto or self.key)) values = l[1:-1].strip() if not values: self.default = '[]' -- cgit v1.2.1