Skip to content

Commit c3950d6

Browse files
committed
improve empty check
Signed-off-by: Zen <[email protected]>
1 parent a39c42a commit c3950d6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "zenlib"
7-
version = "2.0.2"
7+
version = "2.0.3"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

src/zenlib/util/check_dict.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "1.0.0"
2+
__version__ = "1.1.0"
33

44

55
from functools import wraps
@@ -65,6 +65,8 @@ def dispatch_msg(msg):
6565
return dispatch_msg("[%s] Key is set when it should be unset: %s." % (func.__name__, dict_val))
6666
if not_empty and not dict_val:
6767
return dispatch_msg("[%s] Key is empty: %s." % (func.__name__, key))
68+
elif not_empty:
69+
return dispatch_msg("[%s] Unable to find key: %s." % (func.__name__, key))
6870
elif not unset:
6971
raise ValueError("Unable to find key: %s." % key)
7072

0 commit comments

Comments
 (0)