python: Fix error handling.
authorJustus Winter <justus@g10code.com>
Thu, 2 Jun 2016 13:32:35 +0000 (15:32 +0200)
committerJustus Winter <justus@g10code.com>
Mon, 6 Jun 2016 12:16:04 +0000 (14:16 +0200)
* lang/python/gpgme.i (object_to_gpgme_t): Properly propagate
exceptions.

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

index 4c020ff..0d1322c 100644 (file)
@@ -96,14 +96,7 @@ PyObject* object_to_gpgme_t(PyObject* input, const char* objtype, int argnum) {
         }
     }
   else
-    {
-      PyErr_Format(PyExc_TypeError,
-                   "Protocol violation: Expected an instance of type str "
-                   "from _getctype, but got %s",
-                   pyname == NULL ? "NULL"
-                   : (pyname == Py_None ? "None" : pyname->ob_type->tp_name));
-      return NULL;
-    }
+    return NULL;
 
   Py_DECREF(pyname);
   pypointer = PyObject_GetAttrString(input, "wrapped");