Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 swig/swig#2907 Signed-off-by: Brandon Maier <[email protected]> Signed-off-by: David Gibson <[email protected]>
- Loading branch information