summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2018-02-13 21:13:20 +0000
committerPeter Eisentraut2018-05-03 17:13:09 +0000
commitfa03769e4c4bf0911da71fba2501006b05ea195a (patch)
treef9d4d77c4cccf688562df5f9839198ae3083e7c2
parent8f9be261f43772ccee2eae94d971bac6557cbe6a (diff)
Tweak tests to support Python 3.7
Python 3.7 removes the trailing comma in the repr() of BaseException (see <https://bugs.python.org/issue30399>), leading to test output differences. Work around that by composing the equivalent test output in a more manual way.
-rw-r--r--src/pl/plpython/expected/plpython_subtransaction.out6
-rw-r--r--src/pl/plpython/sql/plpython_subtransaction.sql2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/pl/plpython/expected/plpython_subtransaction.out b/src/pl/plpython/expected/plpython_subtransaction.out
index da3b312a06..b38cde8d2d 100644
--- a/src/pl/plpython/expected/plpython_subtransaction.out
+++ b/src/pl/plpython/expected/plpython_subtransaction.out
@@ -134,7 +134,7 @@ with plpy.subtransaction():
except plpy.SPIError, e:
if not swallow:
raise
- plpy.notice("Swallowed %r" % e)
+ plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
return "ok"
$$ LANGUAGE plpythonu;
SELECT subtransaction_nested_test();
@@ -153,7 +153,7 @@ SELECT * FROM subtransaction_tbl;
TRUNCATE subtransaction_tbl;
SELECT subtransaction_nested_test('t');
-NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
+NOTICE: Swallowed SyntaxError('syntax error at or near "error"')
subtransaction_nested_test
----------------------------
ok
@@ -178,7 +178,7 @@ with plpy.subtransaction():
return "ok"
$$ LANGUAGE plpythonu;
SELECT subtransaction_deeply_nested_test();
-NOTICE: Swallowed SyntaxError('syntax error at or near "error"',)
+NOTICE: Swallowed SyntaxError('syntax error at or near "error"')
subtransaction_deeply_nested_test
-----------------------------------
ok
diff --git a/src/pl/plpython/sql/plpython_subtransaction.sql b/src/pl/plpython/sql/plpython_subtransaction.sql
index 3c188e3dd2..398c65720c 100644
--- a/src/pl/plpython/sql/plpython_subtransaction.sql
+++ b/src/pl/plpython/sql/plpython_subtransaction.sql
@@ -80,7 +80,7 @@ with plpy.subtransaction():
except plpy.SPIError, e:
if not swallow:
raise
- plpy.notice("Swallowed %r" % e)
+ plpy.notice("Swallowed %s(%r)" % (e.__class__.__name__, e.args[0]))
return "ok"
$$ LANGUAGE plpythonu;