summaryrefslogtreecommitdiff
path: root/collect
diff options
context:
space:
mode:
Diffstat (limited to 'collect')
-rw-r--r--collect/bst.py4
-rw-r--r--collect/shared_dict.py3
2 files changed, 4 insertions, 3 deletions
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
diff --git a/collect/shared_dict.py b/collect/shared_dict.py
index 7c84c14..ac390bc 100644
--- a/collect/shared_dict.py
+++ b/collect/shared_dict.py
@@ -74,6 +74,7 @@ class SharedDict(object):
super().__init__()
self.name = name
self._serializer = PickleSerializer()
+ assert size_bytes is None or size_bytes > 0
self.shared_memory = self._get_or_create_memory_block(name, size_bytes)
self._ensure_memory_initialization()
self.lock = RLock()
@@ -89,7 +90,7 @@ class SharedDict(object):
try:
return shared_memory.SharedMemory(name=name)
except FileNotFoundError:
- assert size_bytes
+ assert size_bytes is not None
return shared_memory.SharedMemory(name=name, create=True, size=size_bytes)
def _ensure_memory_initialization(self):