Skip to content

Commit

Permalink
python: Handle new pylint possibly-used-before-assignment warning
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Chancellor <[email protected]>
  • Loading branch information
nathanchance committed May 15, 2024
1 parent aa2b141 commit 8f28860
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions python/pgo-llvm-builder/stitch_rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ def generate_rust_toml(version):
download_and_verify(toml_url, toml_dst)
print()

# This pylint warning cannot tell that if we cannot import tomllib above,
# the script exits.
# pylint: disable-next=possibly-used-before-assignment
return tomllib.loads(toml_dst.read_text(encoding='utf-8'))


Expand Down
2 changes: 2 additions & 0 deletions python/scripts/nas_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ def download_items(targets, network_folder):
base_ubuntu_url = f"https://releases.ubuntu.com/{ubuntu_subver}"
elif arch == 'arm64':
base_ubuntu_url = f"https://cdimage.ubuntu.com/releases/{ubuntu_ver}/release"
else:
raise RuntimeError(f"Cannot handle Ubuntu architecture '{arch}'?")

items += [{
'containing_folder': Path(firmware_folder, 'Ubuntu', ubuntu_ver, 'Server'),
Expand Down
2 changes: 2 additions & 0 deletions python/setup/equinix.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ def partition_drive(drive_path, mountpoint, username):
part = 'p1'
elif '/dev/sd' in drive_path:
part = '1'
else:
raise RuntimeError("Cannot handle drive path '{drive_path}'?")

volume = Path(drive_path + part)

Expand Down

0 comments on commit 8f28860

Please sign in to comment.