mesonlib: Add better errormessage to typelistify

pull/8162/head
Dylan Baker 4 years ago
parent 80ec157e5e
commit 9cebd29da9
  1. 2
      ci/ciimage/ubuntu-rolling/install.sh
  2. 4
      mesonbuild/mesonlib/universal.py

@ -27,7 +27,7 @@ pkgs=(
libblocksruntime-dev
libperl-dev
liblapack-dev libscalapack-mpi-dev
rust-bindgen
bindgen
)
sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list"

@ -1262,10 +1262,10 @@ def typeslistify(item: 'T.Union[_T, T.Sequence[_T]]',
if isinstance(item, types):
item = T.cast(T.List[_T], [item])
if not isinstance(item, list):
raise MesonException('Item must be a list or one of {!r}'.format(types))
raise MesonException('Item must be a list or one of {!r}, not {!r}'.format(types, type(item)))
for i in item:
if i is not None and not isinstance(i, types):
raise MesonException('List item must be one of {!r}'.format(types))
raise MesonException('List item must be one of {!r}, not {!r}'.format(types, type(i)))
return item

Loading…
Cancel
Save