diff options
author | Xin Long <lucien.xin@gmail.com> | 2018-07-25 16:43:22 +0800 |
---|---|---|
committer | Jiri Pirko <jiri@mellanox.com> | 2018-07-31 12:15:41 +0200 |
commit | d9769b270608654aa7f07ce48a36f084843daf01 (patch) | |
tree | 8814ffffdfbb1a6b17c332ddbaa7ffc02b0f8eaf | |
parent | a383b64082265dbe379a260292caa4b748366cdf (diff) | |
download | libteam-d9769b270608654aa7f07ce48a36f084843daf01.tar.gz |
binding/python: use SWIG_FromCharPtrAndSize for Python3 support
PyString_FromStringAndSize is replaced with PyUnicode_FromStringAndSize
in Python3, and SWIG_FromCharPtrAndSize will choose the right one with
the check "#if PY_VERSION_HEX >= 0x0300000".
Fixes: 4cb7829debd7 ("add support for hw address manipulation")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
-rw-r--r-- | binding/python/team/capi.i.in | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/binding/python/team/capi.i.in b/binding/python/team/capi.i.in index 5ce4659..c7a5842 100644 --- a/binding/python/team/capi.i.in +++ b/binding/python/team/capi.i.in @@ -40,7 +40,7 @@ int team_hwaddr_set(struct team_handle *th, uint32_t ifindex, const char *addr, if ($1) free($1); } %typemap(argout) (char *addr, unsigned int addr_len) { - $result = SWIG_Python_AppendOutput($result, PyString_FromStringAndSize($1,$2)); + $result = SWIG_Python_AppendOutput($result, SWIG_FromCharPtrAndSize($1,$2)); } %apply char *OUTPUT {char *addr}; int team_hwaddr_get(struct team_handle *th, uint32_t ifindex, char *addr, unsigned int addr_len); |