Skip to content

Commit

Permalink
Fix use of unbound local variable
Browse files Browse the repository at this point in the history
new_redirect was used before declared
  • Loading branch information
britzl committed May 15, 2024
1 parent a725bec commit c0599e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions build_tools/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,11 @@ def move_release(archive_path, sha1, channel):
continue

# copy the file to the new location
print("Copy object: %s -> %s" % (obj.key, new_key))
print("Create redirection %s to %s\n" % (obj.key, new_redirect))
new_object = bucket.Object(new_key)
new_redirect = "http://%s/%s" % (bucket_name, new_key)

print("Copy object: %s -> %s" % (obj.key, new_key))
print("Create redirection %s to %s\n" % (obj.key, new_redirect))
new_object.copy_from(
CopySource={'Bucket': bucket_name, 'Key': obj.key}
)
Expand Down

0 comments on commit c0599e5

Please sign in to comment.