diff options
author | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-20 21:36:08 -0500 |
---|---|---|
committer | Christopher Allan Webber <cwebber@dustycloud.org> | 2011-08-20 21:36:08 -0500 |
commit | c02bea6fb9a87e4cbcb8d77912a92b2226b4eceb (patch) | |
tree | 1db6bbad146a77e212e05ec85db65236122b91e6 | |
parent | cd8c65133e493730d9eb4c67f691d100c845a634 (diff) | |
download | mediagoblin-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.py | 3 |
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" |