def _get_bucket_region(client, bucket_name): """Look up the given bucket's location constraint and translate it to a region name.""" resp = client.get_bucket_location(Bucket=bucket_name) return resp['LocationConstraint'] or _S3_REGION_WITH_NO_LOCATION_CONSTRAINT