From 1dab839de49be7ef92f274416b417b2007c1d9bd Mon Sep 17 00:00:00 2001 From: Hengqing Hu Date: Mon, 31 Aug 2015 15:58:13 +0800 Subject: [PATCH] Expose exception objects via the as keyword According to Python 3 Porting guide http://docs.pythonsprints.com/python3_porting/py-porting.html Exceptions were changed in a few ways for Python 3. First, strings are no longer usable as exceptions. Additionally, the raise syntax no longer accepts comma-separated arguments, instead working with exception instances. Perhaps the largest difference in Python 3 is that exception objects are only available via the as keyword, which was introduced in 2.6. Change-Id: Ide665ecc4b7f14bd58bafab47e05a86a4cf2d141 Closes-Bug: #1490526 --- ansible/library/merge_configs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/library/merge_configs.py b/ansible/library/merge_configs.py index 155291d0e4..e894322ed5 100644 --- a/ansible/library/merge_configs.py +++ b/ansible/library/merge_configs.py @@ -87,7 +87,7 @@ def main(): config.write(f) module.exit_json(changed=changed) - except Exception, e: + except Exception as e: module.exit_json(failed=True, changed=changed, msg=repr(e))