From da52ea1331dfdd03529d81aa40b506f147fbf85b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Wed, 24 Aug 2011 12:06:07 +0200 Subject: [PATCH] - fix crash on removal of local _service file --- osc/core.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/osc/core.py b/osc/core.py index 460b3b48..45e25b38 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2067,9 +2067,10 @@ rev: %s curdir = os.getcwd() os.chdir(self.absdir) # e.g. /usr/lib/obs/service/verify_file fails if not inside the project dir. si = Serviceinfo() - if self.filenamelist.count('_service') or self.filenamelist_unvers.count('_service'): - service = ET.parse(os.path.join(self.absdir, '_service')).getroot() - si.read(service) + if os.path.exists('_service'): + if self.filenamelist.count('_service') or self.filenamelist_unvers.count('_service'): + service = ET.parse(os.path.join(self.absdir, '_service')).getroot() + si.read(service) si.getProjectGlobalServices(self.apiurl, self.prjname, self.name) r = si.execute(self.absdir, mode, singleservice, verbose) os.chdir(curdir)