diff options
author | Patrick McLean <patrick.mclean@sony.com> | 2019-07-25 10:41:38 -0700 |
---|---|---|
committer | Steven Rostedt (VMware) <rostedt@goodmis.org> | 2019-07-25 15:43:32 -0400 |
commit | 68fd0c5ae4e6d1ade6251d9b186ef3a75683d5ad (patch) | |
tree | 9bf0031253c53becc4883a54bf2d011a8dd8f44a | |
parent | dbee104a34030b874330983b8415ce2fadc9ada6 (diff) | |
download | trace-cmd-68fd0c5ae4e6d1ade6251d9b186ef3a75683d5ad.tar.gz |
trace-cmd: In the ctracecmdgui use PyLong on Python 3
Python 3 does not have PyInt anymore, so use the PyLong_* functions when
building on Python 3.
Link: http://lore.kernel.org/linux-trace-devel/20190725174138.3724131-4-chutzpah@gentoo.org
Signed-off-by: Patrick McLean <patrick.mclean@sony.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r-- | python/ctracecmdgui.i | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/python/ctracecmdgui.i b/python/ctracecmdgui.i index 032f3ff8..4a7c6ac6 100644 --- a/python/ctracecmdgui.i +++ b/python/ctracecmdgui.i @@ -37,12 +37,21 @@ pytype_from_gtype(GType gtype) } /* help swig cope with g* types */ +#if PY_MAJOR_VERSION >= 3 +%typemap(in) gint { + $1 = PyLong_AsLong($input); +} +%typemap(out) gint { + $result = PyLong_FromLong($1); +} +#else %typemap(in) gint { $1 = PyInt_AsLong($input); } %typemap(out) gint { $result = PyInt_FromLong($1); } +#endif %typemap(in) guint { $1 = PyLong_AsUnsignedLong($input); } |