mirror of
https://github.com/clearlinux/autospec.git
synced 2026-08-25 17:45:49 +00:00
Test key existance without throwing exceptions
We are speculatively evaluating if a key exists, this can throw a key error exception so avoid that by using get instead.
This commit is contained in:
committed by
William Douglas
parent
798d2a6b0d
commit
1f4ceea069
@@ -450,7 +450,7 @@ class Specfile(object):
|
||||
extract_cmd = 'unzip -q {}'
|
||||
self._write_strip('cd %{_builddir}')
|
||||
archive_file = os.path.basename(archive)
|
||||
if self.archive_details[archive + "prefix"]:
|
||||
if self.archive_details.get(archive + "prefix"):
|
||||
self._write_strip(extract_cmd.format('%{_sourcedir}/' + archive_file))
|
||||
else:
|
||||
# The archive doesn't have a prefix inside, so we have
|
||||
|
||||
Reference in New Issue
Block a user