diff --git a/pyraf/clcache.py b/pyraf/clcache.py index 38f193f3..c23f72b5 100644 --- a/pyraf/clcache.py +++ b/pyraf/clcache.py @@ -48,7 +48,8 @@ def _currentVersion(): - return "4e" if pyrafglobals._use_ecl else "4c" + v = "4e" if pyrafglobals._use_ecl else "4c" + return v + str(sqliteshelve.pickle_version) class _FileContentsCache(filecache.FileCacheDict): diff --git a/pyraf/sqliteshelve.py b/pyraf/sqliteshelve.py index 270c02bb..2b3f4a94 100644 --- a/pyraf/sqliteshelve.py +++ b/pyraf/sqliteshelve.py @@ -27,6 +27,10 @@ import os +pickle_protocol = 4 +"""Protocol version to use for pickling objects""" + + class Shelf: """An SQLite implementation of the Python Shelf interface @@ -75,7 +79,7 @@ def __setitem__(self, key, value): """ if self.readonly: raise OSError("Readonly database") - pdata = pickle.dumps(value, protocol=4) + pdata = pickle.dumps(value, protocol=pickle_protocol) cursor = self.db.cursor() try: cursor.execute("insert or replace into shelf (key_str, value_str)"