1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-02-23 18:52:10 +01:00

Merge pull request #155 from arunpersaud/ET.parse_error

More meaningful error if ET.parse runs into problems. Fixes #153.
This commit is contained in:
Adrian Schröter 2015-08-13 07:50:08 +02:00
commit 7352a47930

View File

@ -750,7 +750,13 @@ class Project:
packages_file = os.path.join(self.absdir, store, '_packages')
if os.path.isfile(packages_file) and os.path.getsize(packages_file):
return ET.parse(packages_file)
try:
result = ET.parse(packages_file)
except:
msg = 'Cannot read package file \'%s\'. ' % packages_file
msg += 'You can try to remove it and then run osc repairwc.'
raise oscerr.OscIOError(None, msg)
return result
else:
# scan project for existing packages and migrate them
cur_pacs = []