From cb54abf2b8bc9d64281df8a2ed89b3e305c05442 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Fri, 24 Dec 2010 10:36:57 -0600 Subject: [PATCH] use protocol 2 for pickling, which may help disk size of the brain a bit --- extlib/megahal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extlib/megahal.py b/extlib/megahal.py index cd42b6b..a4a0df6 100644 --- a/extlib/megahal.py +++ b/extlib/megahal.py @@ -136,7 +136,7 @@ class Brain(object): def __init__(self, order, file, timeout): self.timeout = timeout - self.db = shelve.open(file, writeback=True) + self.db = shelve.open(file, protocol=2, writeback=True) if self.db.setdefault('api', API_VERSION) != API_VERSION: raise ValueError('This brain has an incompatible api version: %d != %d' % (self.db['api'], API_VERSION)) if self.db.setdefault('order', order) != order: