Skip to content

Commit 03c82ab

Browse files
committed
improve dict_check contains check logic
Signed-off-by: Zen <[email protected]>
1 parent 860ae29 commit 03c82ab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
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.2.1"
7+
version = "2.2.2"
88
authors = [
99
{ name="Desultory", email="[email protected]" },
1010
]

src/zenlib/util/dict_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = "desultory"
2-
__version__ = "1.2.1"
2+
__version__ = "1.2.2"
33

44
from functools import wraps
55

@@ -25,7 +25,7 @@ def _contains(*args, **kwargs):
2525
value = self.get(key)
2626
if key not in self:
2727
return return_check(self, msg or "[%s] Unable to find key: %s." % (func.__name__, key), raise_exception, log_level)
28-
if is_set and not (value or repr(value) == "PosixPath('.')"):
28+
if is_set and (not value or repr(value) == "PosixPath('.')"):
2929
return return_check(self, msg or "[%s] Key is not set: %s." % (func.__name__, key), raise_exception, log_level)
3030
self.logger.log(debug_level, "[%s] Contains check passed for: %s" % (func.__name__, key))
3131
return func(*args, **kwargs)

0 commit comments

Comments
 (0)