From c02bea6fb9a87e4cbcb8d77912a92b2226b4eceb Mon Sep 17 00:00:00 2001 From: Christopher Allan Webber Date: Sat, 20 Aug 2011 21:36:08 -0500 Subject: [PATCH] Use "with closing(tf)" since TarFile doesn't have .__exit__() --- mediagoblin/gmg_commands/import_export.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mediagoblin/gmg_commands/import_export.py b/mediagoblin/gmg_commands/import_export.py index 83d64313..fd32136c 100644 --- a/mediagoblin/gmg_commands/import_export.py +++ b/mediagoblin/gmg_commands/import_export.py @@ -26,6 +26,7 @@ import subprocess import os.path import os import sys +from contextlib import closing def import_export_parse_setup(subparser): @@ -147,7 +148,7 @@ def _create_archive(args): args.tar_file, mode='w|gz') - with tf: + with closing(tf): tf.add(args.cache_path, 'mediagoblin-data/') print "\n== Archiving done ==\n" -- 2.25.1