From 50ce91b76944315469710bc2105ac112c6f2c07f Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Tue, 28 Jul 2015 17:23:03 -0700 Subject: [PATCH] Wrapped tarfile for py26 --- .../letshelp_letsencrypt/letshelp_letsencrypt_apache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/letshelp-letsencrypt/letshelp_letsencrypt/letshelp_letsencrypt_apache.py b/letshelp-letsencrypt/letshelp_letsencrypt/letshelp_letsencrypt_apache.py index 2d0514a62..c6b1fbfaf 100755 --- a/letshelp-letsencrypt/letshelp_letsencrypt/letshelp_letsencrypt_apache.py +++ b/letshelp-letsencrypt/letshelp_letsencrypt/letshelp_letsencrypt_apache.py @@ -1,6 +1,7 @@ #!/usr/bin/env python """Let's Encrypt Apache configuration submission script""" import argparse +import contextlib import os import subprocess import sys @@ -286,7 +287,8 @@ def main(): make_and_verify_selection(args.server_root, tempdir) tarpath = os.path.join(tempdir, "config.tar.gz") - with tarfile.open(tarpath, mode="w:gz") as tar: + # contextlib.closing used for py26 support + with contextlib.closing(tarfile.open(tarpath, mode="w:gz")) as tar: tar.add(tempdir, arcname=".") # Submit tarpath