pgsql: Fix subtransaction test for Python 3.10

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix subtransaction test for Python 3.10
Date: 2021-06-05 05:26:23
Message-ID: E1lpOpD-0006H8-DF@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix subtransaction test for Python 3.10

Starting with Python 3.10, the stacktrace looks differently:
- PL/Python function "subtransaction_exit_subtransaction_in_with", line 3, in <module>
- s.__exit__(None, None, None)
+ PL/Python function "subtransaction_exit_subtransaction_in_with", line 2, in <module>
+ with plpy.subtransaction() as s:
Using try/except specifically makes the error look always the same.

(See https://github.com/python/cpython/pull/25719 for the discussion
of this change in Python.)

Author: Honza Horak <hhorak(at)redhat(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/853083.1620749597%40sss.pgh.pa.us
RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1959080

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4a682d85a1408e48ac529295c329ba2c17a44724

Modified Files
--------------
src/pl/plpython/expected/plpython_subtransaction.out | 11 +++++++----
src/pl/plpython/sql/plpython_subtransaction.sql | 7 +++++--
2 files changed, 12 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2021-06-05 05:55:19 pgsql: Remove leftover conflict marker
Previous Message Dilip Kumar 2021-06-05 04:44:42 Re: logical decoding bug: segfault in ReorderBufferToastReplace()