diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-16 13:21:33 +0100 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-03-16 09:32:57 -0400 |
commit | 32e49b5ff20bf2868330aa6985a65b3e9323ebd5 (patch) | |
tree | 4a4dafeae0980f50026226adc1c605abc9682583 | |
parent | 598e968993da58c89f773dc732c708a54b0ec8db (diff) | |
download | meson-32e49b5ff20bf2868330aa6985a65b3e9323ebd5.zip meson-32e49b5ff20bf2868330aa6985a65b3e9323ebd5.tar.gz meson-32e49b5ff20bf2868330aa6985a65b3e9323ebd5.tar.bz2 |
coredata: be more robust on unpickling errors
When reverting from 0.57 to 0.56, one can see an error like this:
File /Users/pm215/src/qemu-for-merges/meson/mesonbuild/coredata.py,
line 1016, in load
obj = pickle.load(f)
ModuleNotFoundError: No module named 'mesonbuild.mesonlib.universal';
'mesonbuild.mesonlib' is not a package
FAILED: build.ninja
The reason is that the old version fails to resolve mesonbuild.mesonlib,
which is a similar situation to the existing AttributeError check. Raise
a MesonException for ModuleNotFoundError as well, so that reconfiguration
proceeds using cmd_line.txt.
-rw-r--r-- | mesonbuild/coredata.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 01a29c2..aa83794 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -943,7 +943,7 @@ def load(build_dir: str) -> CoreData: obj = pickle.load(f) except (pickle.UnpicklingError, EOFError): raise MesonException(load_fail_msg) - except AttributeError: + except (ModuleNotFoundError, AttributeError): raise MesonException( "Coredata file {!r} references functions or classes that don't " "exist. This probably means that it was generated with an old " |