diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2017-09-28 16:53:46 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-09-28 17:00:10 +0200 |
commit | 7757a30a6bad8389eae2eec63f2066793e7ef3cf (patch) | |
tree | 96cd10cadfb62d140911c60119965ca4a4f516ca /solenv | |
parent | 4a15820fec68afdbe33de78e33dc1ed62b0e36f3 (diff) |
Python 2.6 compatibility for pack_images.py
Change-Id: I61b315bc644763749acf82d2dd7e4a3140d8f8b1
Reviewed-on: https://gerrit.libreoffice.org/42911
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'solenv')
-rwxr-xr-x | solenv/bin/pack_images.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/solenv/bin/pack_images.py b/solenv/bin/pack_images.py index 9a68d97821f0..0f493c8f3035 100755 --- a/solenv/bin/pack_images.py +++ b/solenv/bin/pack_images.py @@ -14,6 +14,7 @@ from __future__ import with_statement import argparse from collections import OrderedDict +import contextlib import logging import os import shutil @@ -242,7 +243,7 @@ def create_zip_archive(zip_list, links, tmp_dir, tmp_zip_file, sort_file=None): ordered_zip_list = optimize_zip_layout(zip_list, sort_file) - with zipfile.ZipFile(tmp_zip_file, 'w') as tmp_zip: + with contextlib.closing(zipfile.ZipFile(tmp_zip_file, 'w')) as tmp_zip: if links.keys(): LOGGER.info("Add file 'links.txt' to zip archive") create_links_file(tmp_dir, links) |