pgsql: Improve exception usage in PL/Python

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve exception usage in PL/Python
Date: 2011-01-26 23:35:17
Message-ID: E1PiEtR-00038g-Oh@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2011-01-26 23:40:51 Re: Re: [COMMITTERS] pgsql: Get rid of the global variable holding the error state
Previous Message Jan Urbański 2011-01-26 23:25:42 Re: Re: [COMMITTERS] pgsql: Get rid of the global variable holding the error state