Skip to content

Commit

Permalink
Use pickle protocol 4
Browse files Browse the repository at this point in the history
This was added in python 3.4. We could use protocol 5 but we are
still testing python 3.7.
  • Loading branch information
timj committed Jul 26, 2024
1 parent afba9f8 commit 6ed9e0b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/eups/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def printUses(outstrm, productName, versionName=None, eupsenv=None,
usesInfo = eupsenv.uses()
if pickleFile:
with utils.AtomicFile(pickleFile, "wb") as fd:
pickle.dump(usesInfo, fd, protocol=2)
pickle.dump(usesInfo, fd, protocol=4)

userList = eupsenv.uses(productName, versionName, depth, usesInfo=usesInfo)

Expand Down
2 changes: 1 addition & 1 deletion python/eups/stack/ProductStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def persist(self, flavor, file=None):
flavorData = self.lookup[flavor]

with utils.AtomicFile(file, "wb") as fd:
pickle.dump(flavorData, fd, protocol=2)
pickle.dump(flavorData, fd, protocol=4)
# This could fail if another process deleted the file immediately.
with contextlib.suppress(FileNotFoundError):
self.modtimes[file] = os.stat(file).st_mtime
Expand Down

0 comments on commit 6ed9e0b

Please sign in to comment.