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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user