def _handle_artifact(path, response): if path.endswith(".json"): return response.json() if path.endswith(".yml"): return yaml.load_stream(response.text) response.raw.read = functools.partial(response.raw.read, decode_content=True) return response.raw
def _handle_artifact(path, response): if path.endswith(".json"): return response.json() if path.endswith(".yml"): return yaml.load_stream(response.text) return response