From 5dff93638c4443d3afba017f64c9ade69e0fbd3b Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Mon, 24 Aug 2009 20:25:25 +0000
Subject: 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.
---
 src/pl/plpython/sql/plpython_spi.sql | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/pl/plpython/sql/plpython_spi.sql')

diff --git a/src/pl/plpython/sql/plpython_spi.sql b/src/pl/plpython/sql/plpython_spi.sql
index c663298525..2157569f4c 100644
--- a/src/pl/plpython/sql/plpython_spi.sql
+++ b/src/pl/plpython/sql/plpython_spi.sql
@@ -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:
-- 
cgit v1.2.1

