Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boot-utils: Address new pylint possibly-used-before-assignment warnings #120

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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