aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/coredata.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-01-16 10:42:15 -0800
committerXavier Claessens <xclaesse@gmail.com>2019-01-17 13:21:00 -0500
commited0ad91f1cf4fa0fbc492a5c6259b74d45bd911e (patch)
tree9564ebe3bc1510c8a990335972090801230d436e /mesonbuild/coredata.py
parente6df5a758691e7e2a2f3b0c7ad51c3b5f28e1aec (diff)
downloadmeson-ed0ad91f1cf4fa0fbc492a5c6259b74d45bd911e.zip
meson-ed0ad91f1cf4fa0fbc492a5c6259b74d45bd911e.tar.gz
meson-ed0ad91f1cf4fa0fbc492a5c6259b74d45bd911e.tar.bz2
coredata: Handle AttributeError in unpickling coredata
Which can happen due to internal refactorings, such as the removal of the ConfData class between 0.49 and 0.50
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r--mesonbuild/coredata.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py
index d5f7d94..ef16cae 100644
--- a/mesonbuild/coredata.py
+++ b/mesonbuild/coredata.py
@@ -1,4 +1,4 @@
-# Copyright 2012-2018 The Meson development team
+# Copyright 2012-2019 The Meson development team
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -645,6 +645,11 @@ def load(build_dir):
obj = pickle.load(f)
except pickle.UnpicklingError:
raise MesonException(load_fail_msg)
+ except AttributeError:
+ raise MesonException(
+ "Coredata file {!r} references functions or classes that don't "
+ "exist. This probably means that it was generated with an old "
+ "version of meson.".format(filename))
if not isinstance(obj, CoreData):
raise MesonException(load_fail_msg)
if obj.version != version: