Skip to content

Commit

Permalink
Merge pull request #120 from nathanchance/fix-pylint-possibly-used-be…
Browse files Browse the repository at this point in the history
…fore-assignment
  • Loading branch information
msfjarvis authored May 15, 2024
2 parents 9d1c9e9 + 1e8f7fd commit ddb4c86
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions boot-qemu.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ def _get_kernel_ver_tuple(self, decomp_prog):
utils.check_cmd(decomp_prog)
if decomp_prog in ('gzip', ):
decomp_cmd = [decomp_prog, '-c', '-d', self.kernel]
else:
raise RuntimeError(
f"Unsupported decompression program ('{decomp_prog}')?")
decomp = subprocess.run(decomp_cmd, capture_output=True, check=True)

utils.check_cmd('strings')
Expand Down
3 changes: 3 additions & 0 deletions utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ def prepare_initrd(architecture, rootfs_format='cpio', gh_json_file=None):

# Download the ramdisk if it is not already downloaded
if not src.exists():
# gh_json_rel cannot be unset when used here because the elif condition
# above is the same as this one, which causes the script to exit.
# pylint: disable-next=possibly-used-before-assignment
download_initrd(gh_json_rel, src)
# If it is already downloaded, check that it is up to date and download
# an update only if necessary.
Expand Down

0 comments on commit ddb4c86

Please sign in to comment.