From 6a9e774f87ac4077aeef1cbfd9781e7e773a88a8 Mon Sep 17 00:00:00 2001 From: Catalin Iacob Date: Mon, 29 Feb 2016 17:10:09 +0100 Subject: [PATCH 5/5] Improve comments --- src/pl/plpython/plpy_elog.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c index a92c291..8e8db5d 100644 --- a/src/pl/plpython/plpy_elog.c +++ b/src/pl/plpython/plpy_elog.c @@ -418,7 +418,8 @@ PLy_get_spi_error_data(PyObject *exc, int *sqlerrcode, char **detail, /* * Extract the error data from an Error. - * Note: position and query fields are not used in Python Error exception ever. + * Note: position and query attributes are never set for Error so, unlike + * PLy_get_spi_error_data, this function doesn't return them. */ static void PLy_get_error_data(PyObject *exc, int *sqlerrcode, char **detail, char **hint, @@ -515,7 +516,7 @@ PLy_exception_set_plural(PyObject *exc, PyErr_SetString(exc, buf); } -/* set exceptions from an ErrorData */ +/* set attributes of the given exception to details from ErrorData */ void PLy_exception_set_with_details(PyObject *excclass, ErrorData *edata) { @@ -573,7 +574,7 @@ failure: elog(ERROR, "could not convert error to Python exception"); } -/* get string value of object field */ +/* get string value of an object attribute */ static void get_string_attr(PyObject *obj, char *attrname, char **str) { @@ -587,7 +588,9 @@ get_string_attr(PyObject *obj, char *attrname, char **str) Py_XDECREF(val); } -/* set a string field of object, returns true when the change was success */ +/* set an object attribute to a string value, returns true when the set was + * successful + */ static bool set_string_attr(PyObject *obj, char *attrname, char *str) { -- 2.7.1