]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix subtransaction test for Python 3.10
authorPeter Eisentraut <peter@eisentraut.org>
Sat, 5 Jun 2021 05:16:34 +0000 (07:16 +0200)
committerPeter Eisentraut <peter@eisentraut.org>
Thu, 17 Jun 2021 07:03:30 +0000 (09:03 +0200)
commit6b6fbfd7e299e96c3910650b0e192ca05fb590a6
treea1a722558cb02664c3960e054fa34dc02ce423af
parentff33be61f212a521449565829904adab3e738524
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@redhat.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
src/pl/plpython/expected/plpython_subtransaction.out
src/pl/plpython/sql/plpython_subtransaction.sql