Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions hazelcast/proxy/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def add_entry_listener(
LOADED=loaded_func,
)

if key is not None and predicate:
if key is not None and predicate is not None:
try:
key_data = self._to_data(key)
predicate_data = self._to_data(predicate)
Expand Down Expand Up @@ -215,7 +215,7 @@ def add_entry_listener(
)
response_decoder = with_key_and_predicate_codec.decode_response
event_message_handler = with_key_and_predicate_codec.handle
elif key is not None and not predicate:
elif key is not None and predicate is None:
try:
key_data = self._to_data(key)
except SchemaNotReplicatedError as e:
Expand All @@ -242,7 +242,7 @@ def add_entry_listener(
)
response_decoder = with_key_codec.decode_response
event_message_handler = with_key_codec.handle
elif key is None and predicate:
elif key is None and predicate is not None:
try:
predicate = self._to_data(predicate)
except SchemaNotReplicatedError as e:
Expand Down
6 changes: 3 additions & 3 deletions hazelcast/proxy/replicated_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def add_entry_listener(
Returns:
A registration id which is used as a key to remove the listener.
"""
if key is not None and predicate:
if key is not None and predicate is not None:
try:
key_data = self._to_data(key)
predicate_data = self._to_data(predicate)
Expand All @@ -103,7 +103,7 @@ def add_entry_listener(
)
response_decoder = with_key_and_predicate_codec.decode_response
event_message_handler = with_key_and_predicate_codec.handle
elif key is not None and not predicate:
elif key is not None and predicate is None:
try:
key_data = self._to_data(key)
except SchemaNotReplicatedError as e:
Expand All @@ -123,7 +123,7 @@ def add_entry_listener(
request = with_key_codec.encode_request(self.name, key_data, self._is_smart)
response_decoder = with_key_codec.decode_response
event_message_handler = with_key_codec.handle
elif key is None and predicate:
elif key is None and predicate is not None:
try:
predicate = self._to_data(predicate)
except SchemaNotReplicatedError as e:
Expand Down
Loading