X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=collect%2Fbst.py;h=8602ce698d9c5d7970f890cfd97d97b8ccb4ffda;hb=7ff2af6fe7bffea90dc4a31c93140c189917c659;hp=9d6525946e8131728896d86f3400c38c5ba528e7;hpb=6ba90a1f30f1c0cf4df12fcd0c62181f29bc3668;p=python_utils.git diff --git a/collect/bst.py b/collect/bst.py index 9d65259..8602ce6 100644 --- a/collect/bst.py +++ b/collect/bst.py @@ -520,12 +520,12 @@ class BinarySearchTree(object): return x path = self.parent_path(node) - assert path[-1] + assert path[-1] is not None assert path[-1] == node path = path[:-1] path.reverse() for ancestor in path: - assert ancestor + assert ancestor is not None if node != ancestor.right: return ancestor node = ancestor