Last active
October 15, 2021 05:22
-
-
Save andgineer/1777396a8ed299fdd43e9d6c1869e01e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def create_object(s3=None): | |
session = get_session() if s3 is None else None | |
with session.create_client( | |
"s3" | |
) if s3 is None else contextlib.nullcontext() as s3_temp: | |
return (s3 or s3_temp).get_object(Bucket=bucket, Key=key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment