Skip to content

Commit e27aa55

Browse files
authored
Merge pull request #32 from rayokota/fix-dt-pict
Add bounds check for picture analysis
2 parents b73853a + 4478544 commit e27aa55

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/jsonata/datetimeutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def _analyse_datetime_picture(picture: str) -> PictureFormat:
524524
while pos < len(picture):
525525
if picture[pos] == '[':
526526
# check it's not a doubled [[
527-
if picture[pos + 1] == '[':
527+
if pos + 1 < len(picture) and picture[pos + 1] == '[':
528528
# literal [
529529
format.add_literal(picture, start, pos)
530530
format.parts.append(DateTimeUtils.SpecPart("literal", value="["))

0 commit comments

Comments
 (0)