pgsql: Improve exception usage in PL/Python

Started by Peter Eisentrautover 15 years ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

Improve exception usage in PL/Python

Use the built-in TypeError, not SPIError, for errors having to do with
argument counts or types. Use SPIError, not simply plpy.Error, for
errors in PLy_spi_execute_plan. Finally, do not set a Python
exception if PyArg_ParseTuple failed, as it already sets the correct
exception.

Jan Urbański

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=582b5ac62e74a553e72151b321804a7b2e5fed6f

Modified Files
--------------
src/pl/plpython/expected/plpython_unicode_2.out | 2 +-
src/pl/plpython/expected/plpython_unicode_3.out | 2 +-
src/pl/plpython/plpython.c | 12 ++++--------
3 files changed, 6 insertions(+), 10 deletions(-)