diff options
author | Justus Winter <[email protected]> | 2016-06-01 12:16:27 +0000 |
---|---|---|
committer | Justus Winter <[email protected]> | 2016-06-01 12:18:45 +0000 |
commit | 73c47535b631a55687ecc5eff1d1d9a9fd71021e (patch) | |
tree | 9b5c665b9c896e451c132207e8b4301217499d14 /lang/python/helpers.c | |
parent | Cpp: Use whitelist for status messages (diff) | |
download | gpgme-73c47535b631a55687ecc5eff1d1d9a9fd71021e.tar.gz gpgme-73c47535b631a55687ecc5eff1d1d9a9fd71021e.zip |
python: Improve build system integration, fix warnings.
* lang/python/Makefile.am: Pass CFLAGS to python build system.
* lang/python/helpers.c (pyPassphraseCb): Use correct type for length.
(pygpgme_data_new_from_cbs): Drop unused variable.
Signed-off-by: Justus Winter <[email protected]>
Diffstat (limited to 'lang/python/helpers.c')
-rw-r--r-- | lang/python/helpers.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |