1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-27 07:06:13 +01:00

- handle error resulting from unexpected zero-length .osc/_files metadata

by raising oscerr.NoWorkingCopy()
This commit is contained in:
Dr. Peter Poeml 2008-06-10 10:15:49 +00:00
parent 06c2cbf882
commit bce87c182d

View File

@ -1267,7 +1267,13 @@ def findpacs(files):
def read_filemeta(dir):
return ET.parse(os.path.join(dir, store, '_files'))
try:
r = ET.parse(os.path.join(dir, store, '_files'))
except SyntaxError, e:
raise oscerr.NoWorkingCopy('\'%s\' is not a valid working copy.\n'
'When parsing .osc/_files, the following error was encountered:\n'
'%s' % (dir, e))
return r
def read_tobedeleted(dir):