Improved printing of Python exceptions in PL/Python
Peter Eisentraut <peter_e@gmx.net>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpython/expected/plpython_error_2.out | deleted | +0 −124 |
| src/pl/plpython/expected/plpython_error.out | modified | +6 −6 |
| src/pl/plpython/expected/plpython_unicode_2.out | modified | +3 −3 |
| src/pl/plpython/expected/plpython_unicode_3.out | modified | +3 −3 |
| src/pl/plpython/expected/plpython_unicode_5.out | deleted | +0 −52 |
| src/pl/plpython/expected/README | modified | +1 −5 |
| src/pl/plpython/plpython.c | modified | +33 −15 |