aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Allan Webber <cwebber@dustycloud.org>2011-08-20 21:36:08 -0500
committerChristopher Allan Webber <cwebber@dustycloud.org>2011-08-20 21:36:08 -0500
commitc02bea6fb9a87e4cbcb8d77912a92b2226b4eceb (patch)
tree1db6bbad146a77e212e05ec85db65236122b91e6
parentcd8c65133e493730d9eb4c67f691d100c845a634 (diff)
downloadmediagoblin-c02bea6fb9a87e4cbcb8d77912a92b2226b4eceb.tar.lz
mediagoblin-c02bea6fb9a87e4cbcb8d77912a92b2226b4eceb.tar.xz
mediagoblin-c02bea6fb9a87e4cbcb8d77912a92b2226b4eceb.zip
Use "with closing(tf)" since TarFile doesn't have .__exit__()
-rw-r--r--mediagoblin/gmg_commands/import_export.py3
1 files changed, 2 insertions, 1 deletions
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"