diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-03-16 13:21:33 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-03-16 10:49:26 -0400 |
commit | ca7b16f93717700d9957ba9be0d968c00e2c6b6a (patch) | |
tree | 982417f4f9e112a7a96261292efc23cad50a90eb | |
parent | 54213683e2d97c1b553282d4e0483387b4e7679f (diff) | |
download | meson-ca7b16f93717700d9957ba9be0d968c00e2c6b6a.zip meson-ca7b16f93717700d9957ba9be0d968c00e2c6b6a.tar.gz meson-ca7b16f93717700d9957ba9be0d968c00e2c6b6a.tar.bz2 |
coredata: be even more robust on unpickling errors
When reverting from 0.62 to 0.59, one can see an error like this:
line 1003, in load
obj = pickle.load(f)
File "/Users/pm215/src/qemu-for-merges/meson/mesonbuild/mesonlib/universal.py",
line 2076, in __setstate__
self.__init__(**state) # type: ignore
TypeError: __init__() got an unexpected keyword argument 'module'
FAILED: build.ninja
Raise a MesonException for TypeError 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 3e267b5..f063e4e 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -1036,7 +1036,7 @@ def load(build_dir: str) -> CoreData: obj = pickle.load(f) except (pickle.UnpicklingError, EOFError): raise MesonException(load_fail_msg) - except (ModuleNotFoundError, AttributeError): + except (TypeError, ModuleNotFoundError, AttributeError): raise MesonException( f"Coredata file {filename!r} references functions or classes that don't " "exist. This probably means that it was generated with an old " |