fixing ruff EM102

This commit is contained in:
Isidro Arias 2023-06-03 20:21:23 +02:00
parent 4a13d5d118
commit 2791958f9a

View File

@ -180,7 +180,8 @@ class BinarySearchTree:
# Look for the node with that label
node = self.search(value)
if node is None:
raise ValueError(f"Value {value} not found")
msg = f"Value {value} not found"
raise ValueError(msg)
if node.left is None and node.right is None: # If it has no children
self.__reassign_nodes(node, None)