]> granicus.if.org Git - postgresql/commit
Improved printing of Python exceptions in PL/Python
authorPeter Eisentraut <peter_e@gmx.net>
Sat, 16 Jan 2010 11:03:51 +0000 (11:03 +0000)
committerPeter Eisentraut <peter_e@gmx.net>
Sat, 16 Jan 2010 11:03:51 +0000 (11:03 +0000)
commit44e03742d87ea518990ce9e20bee53c239456f20
tree36a291e5e89e760597d352b2d5527eb0fb1b2c2e
parent2edc31c439da20a6a43a27ca1e09aed0f26d324c
Improved printing of Python exceptions in PL/Python

Mimic the Python interpreter's own logic for printing exceptions instead
of just using the straight str() call, so that
you get

    plpy.SPIError

instead of

    <class 'plpy.SPIError'>

and for built-in exceptions merely

    UnicodeEncodeError

Besides looking better this cuts down on the endless version differences
in the regression test expected files.
src/pl/plpython/expected/README
src/pl/plpython/expected/plpython_error.out
src/pl/plpython/expected/plpython_error_2.out [deleted file]
src/pl/plpython/expected/plpython_unicode_2.out
src/pl/plpython/expected/plpython_unicode_3.out
src/pl/plpython/expected/plpython_unicode_5.out [deleted file]
src/pl/plpython/plpython.c