X-Git-Url: http://git.maemo.org/git/?p=theonering;a=blobdiff_plain;f=src%2Fgvoice%2Fconversations.py;h=fed382b7d2ef8fe9ad4086ddbe0391a7a78b3044;hp=f64c9f7ec8c5c6f5b326a8d437471ccef9b14c08;hb=074b7adedaeba92d5993f8015be26c684f8bbfd8;hpb=548c58651ec7849619b9d823fdeee169be6c87b5;ds=sidebyside diff --git a/src/gvoice/conversations.py b/src/gvoice/conversations.py index f64c9f7..fed382b 100644 --- a/src/gvoice/conversations.py +++ b/src/gvoice/conversations.py @@ -36,15 +36,20 @@ class Conversations(object): try: with open(path, "rb") as f: fileVersion, fileBuild, convs = pickle.load(f) - except (pickle.PickleError, IOError): + except (pickle.PickleError, IOError, EOFError, ValueError): _moduleLogger.exception("While loading for %s" % self._name) return - if fileVersion == constants.__version__ and fileBuild == constants.__build__: + if misc_utils.compare_versions( + misc_utils.parse_version("0.8.0"), + misc_utils.parse_version(fileVersion), + ) <= 0: self._conversations = convs else: _moduleLogger.debug( - "%s Skipping cache due to version mismatch (%s-%s)" % (self._name, fileVersion, fileBuild) + "%s Skipping cache due to version mismatch (%s-%s)" % ( + self._name, fileVersion, fileBuild + ) ) def save(self, path):