From 5dff93638c4443d3afba017f64c9ade69e0fbd3b Mon Sep 17 00:00:00 2001 From: Peter Eisentraut 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_global.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/pl/plpython/sql/plpython_global.sql') diff --git a/src/pl/plpython/sql/plpython_global.sql b/src/pl/plpython/sql/plpython_global.sql index e676ad6f43..32502b41ee 100644 --- a/src/pl/plpython/sql/plpython_global.sql +++ b/src/pl/plpython/sql/plpython_global.sql @@ -4,18 +4,18 @@ CREATE FUNCTION global_test_one() returns text AS -'if not SD.has_key("global_test"): +'if "global_test" not in SD: SD["global_test"] = "set by global_test_one" -if not GD.has_key("global_test"): +if "global_test" not in GD: GD["global_test"] = "set by global_test_one" return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]' LANGUAGE plpythonu; CREATE FUNCTION global_test_two() returns text AS -'if not SD.has_key("global_test"): +'if "global_test" not in SD: SD["global_test"] = "set by global_test_two" -if not GD.has_key("global_test"): +if "global_test" not in GD: GD["global_test"] = "set by global_test_two" return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]' LANGUAGE plpythonu; @@ -23,7 +23,7 @@ return "SD: " + SD["global_test"] + ", GD: " + GD["global_test"]' CREATE FUNCTION static_test() returns int4 AS -'if SD.has_key("call"): +'if "call" in SD: SD["call"] = SD["call"] + 1 else: SD["call"] = 1 -- cgit v1.2.1