diff options
Diffstat (limited to 'lang/python')
| -rw-r--r-- | lang/python/Makefile.am | 2 | ||||
| -rw-r--r-- | lang/python/helpers.c | 8 | 
2 files changed, 7 insertions, 3 deletions
| diff --git a/lang/python/Makefile.am b/lang/python/Makefile.am index 80349225..18f77bb7 100644 --- a/lang/python/Makefile.am +++ b/lang/python/Makefile.am @@ -40,7 +40,7 @@ gpgme_wrap.c pyme/pygpgme.py: gpgme.i errors.i gpgme.h copystamp  	  $<  all-local: gpgme_wrap.c pyme/pygpgme.py copystamp -	$(PYTHON) $(srcdir)/setup.py build --verbose +	CFLAGS="$(CFLAGS)" $(PYTHON) $(srcdir)/setup.py build --verbose  clean-local:  	rm -rf -- build gpgme.h errors.i gpgme_wrap.c pyme/pygpgme.py \ diff --git a/lang/python/helpers.c b/lang/python/helpers.c index 4792c87d..4bbc2989 100644 --- a/lang/python/helpers.c +++ b/lang/python/helpers.c @@ -207,7 +207,12 @@ static gpgme_error_t pyPassphraseCb(void *hook,        if (PyBytes_Check(retval))          buf = PyBytes_AsString(retval), len = PyBytes_Size(retval);        else if (PyUnicode_Check(retval)) -        buf = PyUnicode_AsUTF8AndSize(retval, &len); +        { +          Py_ssize_t ssize; +          buf = PyUnicode_AsUTF8AndSize(retval, &ssize); +          assert (! buf || ssize >= 0); +          len = (size_t) ssize; +        }        else          {            PyErr_Format(PyExc_TypeError, @@ -634,7 +639,6 @@ gpgme_error_t pygpgme_data_new_from_cbs(gpgme_data_t *r_data,      pyDataSeekCb,      pyDataReleaseCb,    }; -  PyObject *dataarg = NULL;    assert (PyTuple_Check(pycbs));    assert (PyTuple_Size(pycbs) == 5 || PyTuple_Size(pycbs) == 6); | 
