diff options
Diffstat (limited to 'src/pl/plpython/sql/plpython_test.sql')
-rw-r--r-- | src/pl/plpython/sql/plpython_test.sql | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/pl/plpython/sql/plpython_test.sql b/src/pl/plpython/sql/plpython_test.sql index 6e5b535ceb7..b74c68fe3e6 100644 --- a/src/pl/plpython/sql/plpython_test.sql +++ b/src/pl/plpython/sql/plpython_test.sql @@ -102,8 +102,12 @@ RETURNS void AS $$ kwargs = { "message":_message, "detail":_detail, "hint":_hint, "sqlstate":_sqlstate, "schema":_schema, "table":_table, "column":_column, "datatype":_datatype, "constraint":_constraint } -# ignore None values -plpy.error(**dict((k, v) for k, v in iter(kwargs.items()) if v)) +# 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) $$ LANGUAGE plpythonu; SELECT raise_exception('hello', 'world'); |