From 04aad401867ad3e1519615d8486e32b50dbcb5f5 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 21 Feb 2017 09:27:02 -0500
Subject: Drop support for Python 2.3

There is no specific reason for this right now, but keeping support for
old Python versions around indefinitely increases the maintenance
burden.  The oldest supported Python version is now Python 2.4, which is
still shipped in RHEL/CentOS 5 by default.

In configure, add a check for the required Python version and give a
friendly error message for an old version, instead of relying on an
obscure build error later on.
---
 src/pl/plpython/sql/plpython_ereport.sql | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

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

diff --git a/src/pl/plpython/sql/plpython_ereport.sql b/src/pl/plpython/sql/plpython_ereport.sql
index 2612e93387..889293d33c 100644
--- a/src/pl/plpython/sql/plpython_ereport.sql
+++ b/src/pl/plpython/sql/plpython_ereport.sql
@@ -55,12 +55,8 @@ kwargs = {
     "column_name": _column_name, "datatype_name": _datatype_name,
     "constraint_name": _constraint_name
 }
-# ignore None values - should work on Python2.3
-dict = {}
-for k in kwargs:
-    if kwargs[k] is not None:
-        dict[k] = kwargs[k]
-plpy.error(**dict)
+# ignore None values
+plpy.error(**dict((k, v) for k, v in iter(kwargs.items()) if v))
 $$ LANGUAGE plpythonu;
 
 SELECT raise_exception('hello', 'world');
-- 
cgit v1.2.1

