Skip to content

Commit 2f7d137

Browse files
committed
Fixed a bug with ALLOW_EMPTY_PATHS
1 parent 2d9117c commit 2f7d137

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

dpath/path.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ def paths(obj, dirs=True, leaves=True, path=[], skip=False):
8484

8585
for (k, v) in iteritems:
8686
if issubclass(k.__class__, (string_class)):
87-
if (not k) and (not dpath.options.ALLOW_EMPTY_STRING_KEYS):
88-
raise dpath.exceptions.InvalidKeyName("Empty string keys not allowed without "
89-
"dpath.options.ALLOW_EMPTY_STRING_KEYS=True")
87+
if not k:
88+
if not dpath.options.ALLOW_EMPTY_STRING_KEYS:
89+
raise dpath.exceptions.InvalidKeyName("Empty string keys not allowed without "
90+
"dpath.options.ALLOW_EMPTY_STRING_KEYS=True")
9091
elif (skip and k[0] == '+'):
9192
continue
9293
newpath = path + [[k, v.__class__]]

0 commit comments

Comments
 (0)