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))