1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-08-03 14:13:38 +02:00

avoid bare except

This commit is contained in:
Dirk Müller
2022-10-27 00:22:09 +02:00
parent 774f8406a8
commit fb44c5720e

View File

@@ -78,7 +78,7 @@ class Buildinfo:
localpkgs = localpkgs or []
try:
tree = ET.parse(filename)
except:
except ET.ParseError:
print('could not parse the buildinfo:', file=sys.stderr)
print(open(filename).read(), file=sys.stderr)
sys.exit(1)
@@ -802,7 +802,7 @@ def main(apiurl, opts, argv):
try:
build_root = build_root % {'repo': repo, 'arch': arch,
'project': prj, 'package': pacname, 'apihost': apihost}
except:
except KeyError:
pass
# We configure sccache after pacname, so that in default cases we can have an sccache for each