1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-13 14:22:43 +03:00

Make PL/Python tests more compatible with Python 3

This changes a bunch of incidentially used constructs in the PL/Python
regression tests to equivalent constructs in cases where Python 3 no longer
supports the old syntax.  Support for older Python versions is unchanged.
This commit is contained in:
Peter Eisentraut
2009-08-24 20:25:25 +00:00
parent 8bed238c87
commit 5dff93638c
15 changed files with 60 additions and 48 deletions

View File

@@ -25,7 +25,7 @@ CREATE FUNCTION nested_call_three(a text) RETURNS text
CREATE FUNCTION spi_prepared_plan_test_one(a text) RETURNS text
AS
'if not SD.has_key("myplan"):
'if "myplan" not in SD:
q = "SELECT count(*) FROM users WHERE lname = $1"
SD["myplan"] = plpy.prepare(q, [ "text" ])
try:
@@ -39,7 +39,7 @@ return None
CREATE FUNCTION spi_prepared_plan_test_nested(a text) RETURNS text
AS
'if not SD.has_key("myplan"):
'if "myplan" not in SD:
q = "SELECT spi_prepared_plan_test_one(''%s'') as count" % a
SD["myplan"] = plpy.prepare(q)
try: