##// END OF EJS Templates
Specify protocol 2 for pickleshare, so objects stored by Python 3 can be used in Python 2.
Thomas Kluyver -
Show More
@@ -80,7 +80,9 b' class PickleShareDB(collections.MutableMapping):'
80 parent = fil.parent
80 parent = fil.parent
81 if parent and not parent.isdir():
81 if parent and not parent.isdir():
82 parent.makedirs()
82 parent.makedirs()
83 pickled = pickle.dump(value,fil.open('wb'))
83 # We specify protocol 2, so that we can mostly go between Python 2
84 # and Python 3. We can upgrade to protocol 3 when Python 2 is obsolete.
85 pickled = pickle.dump(value,fil.open('wb'), protocol=2)
84 try:
86 try:
85 self.cache[fil] = (value,fil.mtime)
87 self.cache[fil] = (value,fil.mtime)
86 except OSError,e:
88 except OSError,e:
General Comments 0
You need to be logged in to leave comments. Login now