Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion jsonschema/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ def __init__(self, errors: Iterable[ValidationError] = ()):
for error in errors:
container = self
for element in error.path:
container = container[element]
container = container._contents[element]
container.errors[error.validator] = error

container._instance = error.instance
Expand All @@ -348,6 +348,8 @@ def __getitem__(self, index):
"""
if self._instance is not _unset and index not in self:
self._instance[index]
if index not in self._contents:
return self.__class__()
return self._contents[index]

def __setitem__(self, index: str | int, value: ErrorTree):
Expand Down
Loading