Skip to content

Commit

Permalink
pin pickle protocol to 4 (Python 3.4+) and rebuild cache
Browse files Browse the repository at this point in the history
  • Loading branch information
reece committed Jun 23, 2020
1 parent 1469be3 commit c8a2a54
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions hgvs/utils/PersistentDict.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals

import pickle

protocol = 4

class PersistentDict(dict):
''' Persistent dictionary
Expand All @@ -23,7 +23,7 @@ def sync(self):
if self.flag == 'r':
return
with open(self.filename, 'wb') as f:
pickle.dump(dict(self), f, -1)
pickle.dump(dict(self), f, protocol)

def close(self):
self.sync()
Expand Down
Binary file modified tests/data/cache-py3.hdp
Binary file not shown.
2 changes: 1 addition & 1 deletion tests/test_hgvs_dataproviders_uta.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_get_tx_exons_invalid_alt_aln_method(self):

def test_get_tx_for_gene(self):
tig = self.hdp.get_tx_for_gene("VHL")
self.assertEqual(14, len(tig))
self.assertEqual(16, len(tig))

def test_get_tx_for_gene_invalid_gene(self):
tig = self.hdp.get_tx_for_gene("GENE")
Expand Down

0 comments on commit c8a2a54

Please sign in to comment.