python: Avoid creating SWIG proxy classes.
authorJustus Winter <justus@g10code.com>
Tue, 14 Jun 2016 11:48:33 +0000 (13:48 +0200)
committerJustus Winter <justus@g10code.com>
Thu, 16 Jun 2016 12:19:17 +0000 (14:19 +0200)
* lang/python/Makefile.am (gpgme_wrap.c): Use '-builtin' to make SWIG
generate builtin types for c types.
* lang/python/gpgme.i (pygpgme_wrap_gpgme_data_t): Adapt slightly.

Signed-off-by: Justus Winter <justus@g10code.com>
lang/python/Makefile.am
lang/python/gpgme.i

index e156d46..8f0e74f 100644 (file)
@@ -40,7 +40,7 @@ errors.i:
          `$(GPG_ERROR_CONFIG) --prefix`/include/gpg-error.h >$@
 
 gpgme_wrap.c pyme/pygpgme.py: gpgme.i errors.i gpgme.h copystamp
-       $(SWIG) -python -py3 $(SWIGOPT) \
+       $(SWIG) -python -py3 -builtin $(SWIGOPT) \
          -o $(builddir)/gpgme_wrap.c -outdir $(builddir)/pyme \
          $<
 
index 65cd235..9cc2022 100644 (file)
@@ -373,7 +373,7 @@ FILE *fdopen(int fildes, const char *mode);
 PyObject *
 pygpgme_wrap_gpgme_data_t(gpgme_data_t data)
 {
-  return SWIG_NewPointerObj(data, SWIGTYPE_p_gpgme_data, 0);
+  return SWIG_Python_NewPointerObj(NULL, data, SWIGTYPE_p_gpgme_data, 0);
 }
 
 gpgme_ctx_t