mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-13 18:07:05 +08: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:
@ -79,8 +79,9 @@ SELECT transaction_test4();
|
||||
|
||||
-- commit inside subtransaction (prohibited)
|
||||
DO LANGUAGE plpythonu $$
|
||||
with plpy.subtransaction():
|
||||
plpy.commit()
|
||||
s = plpy.subtransaction()
|
||||
s.enter()
|
||||
plpy.commit()
|
||||
$$;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user