From 267bd1abf092d43201dfb21f990a11263e9870a5 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Fri, 3 Aug 2012 13:48:48 +0800 Subject: [PATCH] conf: error handling if no no section headers --- gitbuildsys/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gitbuildsys/conf.py b/gitbuildsys/conf.py index 3d9487d..8ce768b 100644 --- a/gitbuildsys/conf.py +++ b/gitbuildsys/conf.py @@ -293,7 +293,10 @@ distconf = $build__distconf self.replaced_keys = defaultdict(list) if fpaths: - self.cfgparser.read(fpaths) + try: + self.cfgparser.read(fpaths) + except MissingSectionHeaderError, err: + raise errors.ConfigError('config file error:%s' % err) self._check_passwd() def _lookfor_confs(self): -- 2.7.4