From 06e3950efbfcab986f6b0ff8f4069fdd285bddd4 Mon Sep 17 00:00:00 2001 From: Michael Scherer Date: Mon, 23 May 2016 15:44:57 +0200 Subject: [PATCH] Port patch.py to python3/python2.4 syntax (#2276) --- lib/ansible/modules/extras/.travis.yml | 1 - lib/ansible/modules/extras/files/patch.py | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/extras/.travis.yml b/lib/ansible/modules/extras/.travis.yml index 142d833c715..0435132fef5 100644 --- a/lib/ansible/modules/extras/.travis.yml +++ b/lib/ansible/modules/extras/.travis.yml @@ -76,7 +76,6 @@ env: database/vertica/vertica_schema.py database/vertica/vertica_user.py f5/bigip_gtm_virtual_server.py - files/patch.py monitoring/bigpanda.py monitoring/boundary_meter.py monitoring/circonus_annotation.py diff --git a/lib/ansible/modules/extras/files/patch.py b/lib/ansible/modules/extras/files/patch.py index af3178ba3a3..123d667fdbf 100644 --- a/lib/ansible/modules/extras/files/patch.py +++ b/lib/ansible/modules/extras/files/patch.py @@ -185,7 +185,8 @@ def main(): apply_patch( patch_func, p.src, p.basedir, dest_file=p.dest, binary=p.binary, strip=p.strip, dry_run=module.check_mode, backup=p.backup ) changed = True - except PatchError, e: + except PatchError: + e = get_exception() module.fail_json(msg=str(e)) module.exit_json(changed=changed)