Skip to content

Commit

Permalink
build: Handle EOFError and AttributeError like coredata
Browse files Browse the repository at this point in the history
Fixes #5056
  • Loading branch information
dcbaker authored and nirbheek committed Mar 12, 2019
1 parent dd2c44c commit 89e46f0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mesonbuild/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2307,8 +2307,13 @@ def load(build_dir):
obj = pickle.load(f)
except FileNotFoundError:
raise MesonException(nonexisting_fail_msg)
except pickle.UnpicklingError:
except (pickle.UnpicklingError, EOFError):
raise MesonException(load_fail_msg)
except AttributeError:
raise MesonException(
"Build data file {!r} references functions or classes that don't "
"exist. This probably means that it was generated with an old "
"version of meson. Try running meson {} --wipe".format(filename, build_dir))
if not isinstance(obj, Build):
raise MesonException(load_fail_msg)
return obj
Expand Down

0 comments on commit 89e46f0

Please sign in to comment.