diff options
author | Brendan Le Foll <brendan.le.foll@intel.com> | 2015-10-27 11:38:20 +0000 |
---|---|---|
committer | Brendan Le Foll <brendan.le.foll@intel.com> | 2015-10-27 11:38:21 +0000 |
commit | 083606790061d4c8c70c66007439410ce30de063 (patch) | |
tree | a0c1b888cf222666ce249f1400cbf7378e34cd7b | |
parent | c89b04eb1931dfabc2cf4bf42034fd015fce76ab (diff) |
gpio.c: Fix python3 builds, PyString_AsString not avail
Previous commit to add debugging cause python3 builds to fail because
PyString_AsString is not available on python3 since all strings are uft8
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
-rw-r--r-- | src/gpio/gpio.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gpio/gpio.c b/src/gpio/gpio.c index 1da45a3..6e47a16 100644 --- a/src/gpio/gpio.c +++ b/src/gpio/gpio.c @@ -246,6 +246,8 @@ mraa_gpio_interrupt_handler(void* arg) } else { ret = PyEval_CallObject((PyObject*) dev->isr, arglist); if (ret == NULL) { +// code is python2 only +#if PY_VERSION_HEX < 0x0300000 syslog(LOG_ERR, "gpio: PyEval_CallObject failed"); PyObject *pvalue, *ptype, *ptraceback; PyErr_Fetch(&pvalue, &ptype, &ptraceback); @@ -257,6 +259,7 @@ mraa_gpio_interrupt_handler(void* arg) Py_XDECREF(pvalue); Py_XDECREF(ptype); Py_XDECREF(ptraceback); +#endif } else { Py_DECREF(ret); } |