Fix subtransaction test for Python 3.10
Peter Eisentraut <peter@eisentraut.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/pl/plpython/expected/plpython_subtransaction.out | modified | +7 −4 |
| src/pl/plpython/sql/plpython_subtransaction.sql | modified | +5 −2 |
Discussion
- Python 3.10 breaks regression tests with traceback changes 6 messages · 2021-05-11 → 2021-06-17