Re: [PATCH 4/4] pylibfdt: add FdtRo.getprop_or_none()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Hi Luca,

On Sat, 25 Dec 2021 at 06:26, Luca Weiss <luca@xxxxxxxxx> wrote:
>
> Add a new method that doesn't throw an exception when a property isn't
> found but returns None instead.
>
> Also add a test for the new method.

You can use

getprop(node, prop, quiet=QUIET_NOTFOUND)

>
> Signed-off-by: Luca Weiss <luca@xxxxxxxxx>
> ---
>  pylibfdt/libfdt.i       | 10 ++++++++++
>  tests/pylibfdt_tests.py |  2 ++
>  2 files changed, 12 insertions(+)

Regards,
Simon



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux