summaryrefslogtreecommitdiff
path: root/database/postgresql/postgresql_lang.py
diff options
context:
space:
mode:
Diffstat (limited to 'database/postgresql/postgresql_lang.py')
-rw-r--r--database/postgresql/postgresql_lang.py4
1 files changed, 3 insertions, 1 deletions
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()