Skip to content

Commit

Permalink
Hardening suggestions for codemodder-python / dep-hashes (#274)
Browse files Browse the repository at this point in the history
Use Assignment Expression (Walrus) In Conditional

Co-authored-by: pixeebot[bot] <[email protected]>
  • Loading branch information
pixeebot[bot] and pixeebot authored Feb 21, 2024
1 parent fa6f5c9 commit 951a640
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/codemodder/scripts/get_hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def main():
continue

package_name, version = arg.split("==", 1)
hashes = get_package_hashes(package_name, version)
if hashes:
if hashes := get_package_hashes(package_name, version):
print(f"SHA256 hashes for {package_name}=={version}:")
for hash_value in hashes:
print(hash_value)
Expand Down

0 comments on commit 951a640

Please sign in to comment.