diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2023-03-09 10:20:57 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2023-03-09 19:03:44 -0500 |
commit | 7c2ac4f8fe2bda306adc73572d8f8e43010456cb (patch) | |
tree | 97c23889e0aec53ff81e12ddc19acfae00e26267 /mesonbuild/coredata.py | |
parent | 62c269d08859747ba558e90bc98505e6325ef678 (diff) | |
download | meson-7c2ac4f8fe2bda306adc73572d8f8e43010456cb.zip meson-7c2ac4f8fe2bda306adc73572d8f8e43010456cb.tar.gz meson-7c2ac4f8fe2bda306adc73572d8f8e43010456cb.tar.bz2 |
utils: fix annotation of pickle_load
It's actually Generic, and we should use Generic annotations to get the
correct result. This means that we don't have to assert or cast the
return type, because mypy just knowns
Diffstat (limited to 'mesonbuild/coredata.py')
-rw-r--r-- | mesonbuild/coredata.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 62c81ff..38d6fcf 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -1056,9 +1056,7 @@ def major_versions_differ(v1: str, v2: str) -> bool: def load(build_dir: str) -> CoreData: filename = os.path.join(build_dir, 'meson-private', 'coredata.dat') - obj = pickle_load(filename, 'Coredata', CoreData) - assert isinstance(obj, CoreData), 'for mypy' - return obj + return pickle_load(filename, 'Coredata', CoreData) def save(obj: CoreData, build_dir: str) -> str: |