Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Unified Diff: tools/export_tarball/export_tarball.py

Issue 578019: Make export_tarball.py work with older Pythons. (Closed)
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/export_tarball/export_tarball.py
diff --git a/tools/export_tarball/export_tarball.py b/tools/export_tarball/export_tarball.py
index 607f478f8810b4e7db11a9e83e4f5129c1b42009..6715f110fb92d43108150e4cfe32c8524f4ab23c 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698