From 95de60fd8673993735c4d24dcf2c9377cbfbf702 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 1 Oct 2020 11:21:57 -0700 Subject: [PATCH] Let _api_request return batch responses from batch requests. --- src/mega/mega.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mega/mega.py b/src/mega/mega.py index fbcfa8f..9f38e43 100644 --- a/src/mega/mega.py +++ b/src/mega/mega.py @@ -72,7 +72,10 @@ class Mega: if isinstance(json_resp, int): # If this raises EAGAIN it'll be caught by tenacity retry. raise errors.error_for_code(json_resp) - return json_resp[0] + if len(json_resp) == 1: + return json_resp[0] + else: + return json_resp def _api_account_version_and_salt(self, email): """