From 6c8fddf2dd191224186d6b4f9a7c8f611538c162 Mon Sep 17 00:00:00 2001 From: Zhang Qiang Date: Wed, 24 Oct 2012 21:03:27 +0800 Subject: [PATCH] fix backtrace while trying to remove 'None' file, #490 Change-Id: I7d1b7c3701fb9e36006b7f88a9248feb4bcd4060 --- gitbuildsys/oscapi.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitbuildsys/oscapi.py b/gitbuildsys/oscapi.py index 630bb23..692536a 100644 --- a/gitbuildsys/oscapi.py +++ b/gitbuildsys/oscapi.py @@ -210,6 +210,8 @@ class OSC(object): fnames = [entry.get('name') for entry in \ core.ET.fromstring(responce)] for fname in fnames: + if fname is None: + continue query = 'rev=upload' url = core.makeurl(self.apiurl, ['source', prj, pkg, pathname2url(fname)], @@ -217,8 +219,8 @@ class OSC(object): try: self.core_http(core.http_DELETE, url) except OSCError, err: - raise ObsError("can\'t remove files from %s/%s: %s" \ - % (prj, pkg, err)) + raise ObsError("can\'t remove file %s/%s/%s: %s" \ + % (prj, pkg, fname, err)) def create_package(self, prj, pkg): """Create package in the project.""" -- 2.7.4