diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 09:46:57 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-06 09:46:57 +0000 |
commit | fc16250052b5eb84259870b5079513a5e08cb189 (patch) | |
tree | c8ab6846fb7bab2340f14165cbe9925ac95a1dae /tools/export_tarball | |
parent | 06f35a420e28433170a6c25ac36e21683b8a4430 (diff) | |
download | chromium_src-fc16250052b5eb84259870b5079513a5e08cb189.zip chromium_src-fc16250052b5eb84259870b5079513a5e08cb189.tar.gz chromium_src-fc16250052b5eb84259870b5079513a5e08cb189.tar.bz2 |
Make export_tarball.py work with older Pythons.
TEST=none
BUG=29044
Review URL: http://codereview.chromium.org/578019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38302 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/export_tarball')
-rw-r--r-- | tools/export_tarball/export_tarball.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py index 607f478..6715f11 100644 --- a/tools/export_tarball/export_tarball.py +++ b/tools/export_tarball/export_tarball.py @@ -16,9 +16,6 @@ export_tarball.py /foo/bar The above will create file /foo/bar.tar.bz2. """ -from __future__ import with_statement - -import contextlib import optparse import os import sys @@ -74,9 +71,12 @@ def main(argv): return False - with contextlib.closing(tarfile.open(output_fullname, 'w:bz2')) as archive: + archive = tarfile.open(output_fullname, 'w:bz2') + try: archive.add(GetSourceDirectory(), arcname=output_basename, exclude=ShouldExcludePath) + finally: + archive.close() return 0 |