dtc/pylibfdt
Brandon Maier 9a969f3b70 pylibfdt/libfdt.i: fix backwards compatibility of return values
When our Python functions wrap `fdt_getprop()` they return a list
containing `[*data, length]`.

In SWIG v4.2 and earlier SWIG would discard `*data` if it is NULL/None.
Causing the return value to just be `length`.

But starting in SWIG v4.3 it no longer discards `*data`. So the return
value is now `[None, length]`.

Handle this compatibility issue in libfdt.i by checking if the return
value looks like the older 4.2 return value, and casting it to the newer
style.

See https://github.com/swig/swig/pull/2907

Signed-off-by: Brandon Maier <brandon.maier@gmail.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2024-11-25 12:43:19 +11:00
..
.gitignore Use Python3 by default 2019-03-29 15:43:24 +11:00
libfdt.i pylibfdt/libfdt.i: fix backwards compatibility of return values 2024-11-25 12:43:19 +11:00
Makefile.pylibfdt pylibfdt: Don't emit warnings from swig generate C code 2024-11-06 14:00:45 +11:00
meson.build pylibfdt/meson.build: fix Python library being rebuilt during install 2024-06-26 11:38:22 +10:00