generated from nullndr/pyproj
fixes
This commit is contained in:
@@ -13,19 +13,19 @@ class Tree:
|
||||
return f"{leaf}"
|
||||
return "<empty>"
|
||||
|
||||
def build_tree(args: Tuple):
|
||||
def build_tree(args):
|
||||
if args == None:
|
||||
return None
|
||||
|
||||
if not isinstance(args, tuple):
|
||||
raise "Invalid argument"
|
||||
raise RuntimeError("Invalid argument")
|
||||
|
||||
if len(args) != 3:
|
||||
raise "Invalid number of parameters in the tuple"
|
||||
raise RuntimeError("Invalid number of parameters in the tuple")
|
||||
|
||||
value, right, left = args
|
||||
|
||||
if (not isinstance(right, tuple) and right != None) or (not isinstance(left, tuple) and left != None):
|
||||
raise "Nodes must be tuples"
|
||||
raise RuntimeError("Nodes must be tuples")
|
||||
|
||||
return Tree(value, build_tree(right), build_tree(left))
|
||||
|
||||
Reference in New Issue
Block a user