From f2ce143609d8eb2af9b3d8f6f89f7dd4ea68eb22 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Sun, 16 Oct 2016 16:57:57 +0200 Subject: Make postgresql module in extras compile on py3 --- database/postgresql/postgresql_lang.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'database/postgresql/postgresql_lang.py') diff --git a/database/postgresql/postgresql_lang.py b/database/postgresql/postgresql_lang.py index 73ecb413..a0b24cdd 100644 --- a/database/postgresql/postgresql_lang.py +++ b/database/postgresql/postgresql_lang.py @@ -222,7 +222,8 @@ def main(): try: db_connection = psycopg2.connect(**kw) cursor = db_connection.cursor() - except Exception, e: + except Exception: + e = get_exception() module.fail_json(msg="unable to connect to database: %s" % e) changed = False lang_dropped = False @@ -267,4 +268,5 @@ def main(): # import module snippets from ansible.module_utils.basic import * +from ansible.module_utils.pycompat24 import get_exception main() -- cgit v1.2.1