Browse Source

pylibfdt: check_err accepts only integer as a first argument.

A list passed as an argument to check_err() means that
there is no error code to check and therefore it should
be returned back.

Signed-off-by: Lumir Balhar <lbalhar@redhat.com>
Message-Id: <20190218164856.23861-2-frenzy@frenzy.cz>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
main
Lumir Balhar 6 years ago committed by David Gibson
parent
commit
cb0f454f73
  1. 2
      pylibfdt/libfdt.i

2
pylibfdt/libfdt.i

@ -137,7 +137,7 @@ def check_err(val, quiet=()):
Raises Raises
FdtException if val < 0 FdtException if val < 0
""" """
if val < 0: if isinstance(val, int) and val < 0:
if -val not in quiet: if -val not in quiet:
raise FdtException(val) raise FdtException(val)
return val return val

Loading…
Cancel
Save