Skip to content

Instantly share code, notes, and snippets.

@andgineer
Last active October 15, 2021 05:22
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