Skip to content

Commit

Permalink
Use pickle protocol compatible with Python 3.6
Browse files Browse the repository at this point in the history
Windows builds now use Windows Python 3.9, but
the generated pickles are read by Rocky 8's
Python 3, which is 3.6, so don't exceed the
newest protocol supported by 3.6 (protocol 4).
  • Loading branch information
benmwebb committed Nov 2, 2023
1 parent 46f4ad1 commit 22fed5d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/test/pyext/src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,13 @@ def __init__(self, stream=None, descriptions=None, verbosity=None):

def stopTestRun(self):
if 'IMP_TEST_DETAIL_DIR' in os.environ:
# Various parts of the IMP build pipeline use Python 3.6,
# which predates pickle protocol 5
protocol = min(pickle.HIGHEST_PROTOCOL, 4)
fname = (Path(os.environ['IMP_TEST_DETAIL_DIR'])
/ Path(sys.argv[0]).name)
with open(str(fname), 'wb') as fh:
pickle.dump(self.all_tests, fh, -1)
pickle.dump(self.all_tests, fh, protocol)
super(_TestResult, self).stopTestRun()

def startTest(self, test):
Expand Down

0 comments on commit 22fed5d

Please sign in to comment.