From 4143b7c9dbfdf1d2fece3c05f786346a03405f9b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 23 Mar 2020 19:55:35 -0700 Subject: [PATCH] Check for more target types but also raise TypeError if n/a. --- src/mega/mega.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mega/mega.py b/src/mega/mega.py index 6e72383..6596326 100644 --- a/src/mega/mega.py +++ b/src/mega/mega.py @@ -969,9 +969,16 @@ class Mega: elif isinstance(target, str): target_node_id = target + + elif isinstance(target, dict): + target_node_id = target['h'] + + elif isinstance(target, tuple): + target_node_id = target[1]['h'] + else: - file = target[1] - target_node_id = file['h'] + raise TypeError(target) + request = { 'a': 'm', 'n': file_id,