Skip to content

Commit 3221720

Browse files
author
Mathieu
committed
mockgun: update highest pickle protocol for py3.7
1 parent ff3b358 commit 3221720

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

shotgun_api3/lib/mockgun/schema.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ def _read_file(cls, path):
8484
return pickle.load(fh)
8585

8686

87-
# Highest protocol that Python 2.4 supports, which is the earliest version of Python we support.
88-
# Actually, this is the same version that Python 2.7 supports at the moment!
89-
_HIGHEST_24_PICKLE_PROTOCOL = 2
87+
# Highest protocol that Python 3.7 supports, which is the earliest version of Python we support.
88+
_HIGHEST_37_PICKLE_PROTOCOL = 4
9089

9190

9291
# ----------------------------------------------------------------------------
@@ -108,13 +107,13 @@ def generate_schema(shotgun, schema_file_path, schema_entity_file_path):
108107
schema = shotgun.schema_read()
109108
fh = open(schema_file_path, "wb")
110109
try:
111-
pickle.dump(schema, fh, protocol=_HIGHEST_24_PICKLE_PROTOCOL)
110+
pickle.dump(schema, fh, protocol=_HIGHEST_37_PICKLE_PROTOCOL)
112111
finally:
113112
fh.close()
114113

115114
schema_entity = shotgun.schema_entity_read()
116115
fh = open(schema_entity_file_path, "wb")
117116
try:
118-
pickle.dump(schema_entity, fh, protocol=_HIGHEST_24_PICKLE_PROTOCOL)
117+
pickle.dump(schema_entity, fh, protocol=_HIGHEST_37_PICKLE_PROTOCOL)
119118
finally:
120119
fh.close()

0 commit comments

Comments
 (0)