From: Hoyt Koepke hoytak@gmail.com Date: Tue, 17 Mar 2009 03:10:14 +0000 (-0700) Subject: Made lexicon unpickling more robust; on error it regenerates it. X-Git-Tag: 0.11.1.alpha~49 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=85293286990822e5a1fea54d031b2d0dfe998a90;p=cython.git Made lexicon unpickling more robust; on error it regenerates it. --- diff --git a/Cython/Compiler/Scanning.py b/Cython/Compiler/Scanning.py index 9ef47dc1..6c2144fc 100644 --- a/Cython/Compiler/Scanning.py +++ b/Cython/Compiler/Scanning.py @@ -102,7 +102,12 @@ def try_to_unpickle_lexicon(): if notify_lexicon_unpickling: t0 = time() print("Unpickling lexicon...") - lexicon = pickle.load(f) + try: + lexicon = pickle.load(f) + except Exception, e: + print "WARNING: Exception while loading lexicon pickle, regenerating" + print e + lexicon = None f.close() if notify_lexicon_unpickling: t1 = time()