Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 70293e9

Browse files
committed
Update plpython_subtransaction alternative expected files
The original patch only targeted Python 2.6 and newer, since that is what we have supported in PostgreSQL 13 and newer. For older branches, we need to fix it up for older Python versions.
1 parent 6765cbd commit 70293e9

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

src/pl/plpython/expected/plpython_subtransaction.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ AS $$
239239
try:
240240
with plpy.subtransaction() as s:
241241
s.__exit__(None, None, None)
242-
except ValueError as e:
242+
except ValueError, e:
243243
raise ValueError(e)
244244
$$ LANGUAGE plpythonu;
245245
SELECT subtransaction_exit_without_enter();

src/pl/plpython/expected/plpython_subtransaction_0.out

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio
222222
DETAIL: SyntaxError: invalid syntax (line 3)
223223
CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void
224224
AS $$
225-
with plpy.subtransaction() as s:
226-
s.__exit__(None, None, None)
225+
try:
226+
with plpy.subtransaction() as s:
227+
s.__exit__(None, None, None)
228+
except ValueError, e:
229+
raise ValueError(e)
227230
$$ LANGUAGE plpythonu;
228231
ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with"
229-
DETAIL: SyntaxError: invalid syntax (line 3)
232+
DETAIL: SyntaxError: invalid syntax (line 4)
230233
SELECT subtransaction_exit_without_enter();
231234
ERROR: ValueError: this subtransaction has not been entered
232235
CONTEXT: Traceback (most recent call last):

src/pl/plpython/expected/plpython_subtransaction_5.out

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ ERROR: could not compile PL/Python function "subtransaction_enter_subtransactio
222222
DETAIL: SyntaxError: invalid syntax (<string>, line 3)
223223
CREATE FUNCTION subtransaction_exit_subtransaction_in_with() RETURNS void
224224
AS $$
225-
with plpy.subtransaction() as s:
226-
s.__exit__(None, None, None)
225+
try:
226+
with plpy.subtransaction() as s:
227+
s.__exit__(None, None, None)
228+
except ValueError, e:
229+
raise ValueError(e)
227230
$$ LANGUAGE plpythonu;
228231
ERROR: could not compile PL/Python function "subtransaction_exit_subtransaction_in_with"
229-
DETAIL: SyntaxError: invalid syntax (<string>, line 3)
232+
DETAIL: SyntaxError: invalid syntax (<string>, line 4)
230233
SELECT subtransaction_exit_without_enter();
231234
ERROR: ValueError: this subtransaction has not been entered
232235
CONTEXT: Traceback (most recent call last):

src/pl/plpython/sql/plpython_subtransaction.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ AS $$
161161
try:
162162
with plpy.subtransaction() as s:
163163
s.__exit__(None, None, None)
164-
except ValueError as e:
164+
except ValueError, e:
165165
raise ValueError(e)
166166
$$ LANGUAGE plpythonu;
167167

0 commit comments

Comments
 (0)