Skip to content

Commit e37fdad

Browse files
committed
Continue evaluating entire path when handling int
1 parent 6c513fa commit e37fdad

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dpath/segments.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ def match(segments: Path, glob: Glob):
229229
g = '*'
230230

231231
try:
232-
# If search path segment (s) is an int then assume currently evaluated index (g) might be a sequenc
232+
# If search path segment (s) is an int then assume currently evaluated index (g) might be a sequence
233233
# index as well. Try converting it to an int.
234-
if isinstance(s, int):
235-
return s == int(g)
234+
if isinstance(s, int) and s == int(g):
235+
continue
236236
except:
237237
# Will reach this point if g can't be converted to an int (e.g. when g is a RegEx pattern).
238238
# In this case convert s to a str so fnmatch can work on it.

0 commit comments

Comments
 (0)