Convert exception_from_error_queue() macros into a single function. Besides code maintainability, this makes our fast path shorter for better cache performance.
diff --git a/src/util.c b/src/util.c
index aa9d238..b1faad5 100644
--- a/src/util.c
+++ b/src/util.c
@@ -38,6 +38,13 @@
return errlist;
}
+void exception_from_error_queue(PyObject *the_Error)
+{
+ PyObject *errlist = error_queue_to_list();
+ PyErr_SetObject(the_Error, errlist);
+ Py_DECREF(errlist);
+}
+
/*
* Flush OpenSSL's error queue and ignore the result
*