bitbake/codeparser: Correctly handle a missing/empty cache file

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie 2011-05-05 19:27:46 +01:00
parent e72210c791
commit 72875493b8
1 changed files with 5 additions and 2 deletions

View File

@ -72,8 +72,11 @@ def parser_cache_save(d):
lf = bb.utils.lockfile(cachefile + ".lock")
p = pickle.Unpickler(file(cachefile, "rb"))
data, version = p.load()
try:
p = pickle.Unpickler(file(cachefile, "rb"))
data, version = p.load()
except IOError:
data, version = None, None
if version == PARSERCACHE_VERSION:
for h in data[0]: