SWIG 4.5.0 removed Python 2 compatibility macros (PyInt_*, PyString_*)
from its runtime header pyhead.swg (see commit 79f7a2b7cb7d). Replace
them with their Python 3 C API equivalents:
- PyString_FromString -> PyUnicode_FromString
- PyString_AsString -> PyBytes_AsString
- PyInt_AsLong -> PyLong_AsLong
The replacements are safe since the macros were already aliased to
these exact functions in SWIG's Python 3 code path.
This is a backport of dtc commit 5008d1d6a356 ("pylibfdt: Replace
removed SWIG Python 2 compatibility macros").
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Reviewed-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Tested-by: Jérémie Dautheribes <jeremie.dautheribes@bootlin.com>
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>