Skip to content

Commit b54636b

Browse files
committed
fix logic
Signed-off-by: Zen <[email protected]>
1 parent 41895cc commit b54636b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/zenlib/util/check_dict.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ def dispatch_msg(msg):
5555
return dispatch_msg("[%s] Key is set when it should be unset: %s." % (func.__name__, key))
5656
else:
5757
dict_val = validate_dict[key]
58-
if not_empty and dict_val:
58+
if not_empty and not dict_val:
5959
return dispatch_msg("[%s] Key is not empty: %s." % (func.__name__, key))
6060
elif isinstance(key, dict):
6161
if dict_val := walk_dict(validate_dict, key, fail_safe=not raise_exception):
6262
if unset:
6363
return dispatch_msg("[%s] Key is set when it should be unset: %s." % (func.__name__, dict_val))
64-
if not_empty and dict_val:
64+
if not_empty and not dict_val:
6565
return dispatch_msg("[%s] Key is not empty: %s." % (func.__name__, dict_val))
6666
elif not unset:
6767
raise ValueError("Unable to find key: %s." % key)

0 commit comments

Comments
 (0)