1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-02 11:44:50 +03:00

PL/Python: Fix tests for older Python versions

Commit 8561e4840c81f7e345be2df170839846814fa004 neglected to handle
older Python versions that don't support the "with" statement.  So write
the tests in a way that older versions can handle as well.
This commit is contained in:
Peter Eisentraut 2018-01-22 12:09:52 -05:00
parent 2b792ab094
commit f498704346
2 changed files with 6 additions and 4 deletions

View File

@ -95,7 +95,8 @@ CONTEXT: Traceback (most recent call last):
PL/Python function "transaction_test4"
-- commit inside subtransaction (prohibited)
DO LANGUAGE plpythonu $$
with plpy.subtransaction():
s = plpy.subtransaction()
s.enter()
plpy.commit()
$$;
WARNING: forcibly aborting a subtransaction that has not been exited

View File

@ -79,7 +79,8 @@ SELECT transaction_test4();
-- commit inside subtransaction (prohibited)
DO LANGUAGE plpythonu $$
with plpy.subtransaction():
s = plpy.subtransaction()
s.enter()
plpy.commit()
$$;