From f76fef06b8d7de9db4cc7d0fa89ad8c73522913b Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Mon, 10 Jan 2022 17:55:41 -0800 Subject: [PATCH] Raise TypeError instead of allowing default none return. --- src/mega/mega.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mega/mega.py b/src/mega/mega.py index 52354d4..80ffdeb 100644 --- a/src/mega/mega.py +++ b/src/mega/mega.py @@ -363,15 +363,16 @@ class Mega: return node if isinstance(node, int): return self.get_node_by_type(node)[1] + raise TypeError(f'Invalid node {node}.') def normalize_node_id(self, node): if node is None: return self._root_node_id - elif isinstance(node, int): + if isinstance(node, int): return self.get_node_by_type(node)[1]['h'] - elif isinstance(node, dict): + if isinstance(node, dict): return node['h'] - elif isinstance(node, str): + if isinstance(node, str): return node else: raise TypeError(f'Invalid node {node}.')