diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-03-11 11:57:58 -0700 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2019-03-12 03:54:41 +0000 |
commit | 89e46f0d92834289da66579cb457ddc0504f192d (patch) | |
tree | 7c89bb8bbaeb4852ff25b252fde9d220b0ba1875 | |
parent | dd2c44cdf6f8ed8a969d0666cafb08aaf78a919d (diff) | |
download | meson-89e46f0d92834289da66579cb457ddc0504f192d.tar.gz |
build: Handle EOFError and AttributeError like coredata
Fixes #5056
-rw-r--r-- | mesonbuild/build.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 9a1d15869..d456ab862 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -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 |