diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-01-08 11:39:28 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-01-08 11:39:28 -0500 |
| commit | a66c1fcdd7e4291561c5cdebc1d02784050260e2 (patch) | |
| tree | 10e252f4cddf5e42a2cab0d77bed5407c2e044b7 /src/pl/plpython/expected/plpython_subtransaction.out | |
| parent | 6a1a44037b63e1c0e51dd2ca7374191c2f5362b1 (diff) | |
PL/Python: Make tests pass with Python 3.5
The error message wording for AttributeError has changed in Python 3.5.
For the plpython_error test, add a new expected file. In the
plpython_subtransaction test, we didn't really care what the exception
is, only that it is something coming from Python. So use a generic
exception instead, which has a message that doesn't vary across
versions.
Back-patch of commit f16d52269a196f7f303abe3b978d95ade265f05f, which
was previously back-patched into 9.2-9.4, but missed 9.5.
Diffstat (limited to 'src/pl/plpython/expected/plpython_subtransaction.out')
| -rw-r--r-- | src/pl/plpython/expected/plpython_subtransaction.out | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out index ced4682440e..c7bf6ccd42f 100644 --- a/src/pl/plpython/expected/plpython_subtransaction.out +++ b/src/pl/plpython/expected/plpython_subtransaction.out @@ -19,7 +19,7 @@ try: if what_error == "SPI": plpy.execute("INSERT INTO subtransaction_tbl VALUES ('oops')") elif what_error == "Python": - plpy.attribute_error + raise Exception("Python exception") except: exc = False subxact.__exit__(*sys.exc_info()) @@ -58,10 +58,10 @@ SELECT * FROM subtransaction_tbl; TRUNCATE subtransaction_tbl; SELECT subtransaction_test('Python'); -ERROR: AttributeError: 'module' object has no attribute 'attribute_error' +ERROR: Exception: Python exception CONTEXT: Traceback (most recent call last): PL/Python function "subtransaction_test", line 13, in <module> - plpy.attribute_error + raise Exception("Python exception") PL/Python function "subtransaction_test" SELECT * FROM subtransaction_tbl; i @@ -78,7 +78,7 @@ with plpy.subtransaction(): if what_error == "SPI": plpy.execute("INSERT INTO subtransaction_tbl VALUES ('oops')") elif what_error == "Python": - plpy.attribute_error + raise Exception("Python exception") $$ LANGUAGE plpythonu; SELECT subtransaction_ctx_test(); subtransaction_ctx_test @@ -110,10 +110,10 @@ SELECT * FROM subtransaction_tbl; TRUNCATE subtransaction_tbl; SELECT subtransaction_ctx_test('Python'); -ERROR: AttributeError: 'module' object has no attribute 'attribute_error' +ERROR: Exception: Python exception CONTEXT: Traceback (most recent call last): PL/Python function "subtransaction_ctx_test", line 8, in <module> - plpy.attribute_error + raise Exception("Python exception") PL/Python function "subtransaction_ctx_test" SELECT * FROM subtransaction_tbl; i |
