structurize 2.16.5__py3-none-any.whl → 2.17.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
avrotize/avrotopython.py CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  # pylint: disable=line-too-long,too-many-instance-attributes
4
4
 
5
+ import copy
5
6
  import json
6
7
  import os
7
8
  import re
@@ -257,8 +258,9 @@ class AvroToPython:
257
258
 
258
259
  # we are including a copy of the avro schema of this type. Since that may
259
260
  # depend on other types, we need to inline all references to other types
260
- # into this schema
261
- local_avro_schema = inline_avro_references(avro_schema.copy(), self.type_dict, '')
261
+ # into this schema. We use deepcopy to avoid mutating the original schema
262
+ # which may be shared with type_dict entries
263
+ local_avro_schema = inline_avro_references(copy.deepcopy(avro_schema), self.type_dict, '')
262
264
  avro_schema_json = json.dumps(local_avro_schema).replace('\\"', '\'').replace('"', '\\"')
263
265
  enum_types = []
264
266
  for import_type in import_types: