Skip to content

Commit fd82ab3

Browse files
authored
update deepcopy
1 parent 8456a34 commit fd82ab3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

jsonschema/validators.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,13 @@ def store_subschema(self, schema, last_schema=None, last_url=None):
897897
url, fragment = urldefrag(last_url)
898898

899899
if last_schema:
900-
self.store[url] = last_schema
900+
self.store[url] = copy.deepcopy(last_schema)
901901

902902
if fragment:
903-
self.store[url][fragment] = schema
903+
self.store[url][fragment] = copy.deepcopy(schema)
904904

905-
backup_schema = copy.deepcopy(schema)
906905
if isinstance(schema[k], dict):
907-
self.store_subschema(schema[k], backup_schema, last_url)
906+
self.store_subschema(schema[k], schema, last_url)
908907

909908

910909
def validate(instance, schema, cls=None, *args, **kwargs):

0 commit comments

Comments
 (0)