From 992e80d40019c7b6563d21640824428f71277730 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Sat, 6 Apr 2013 20:35:31 +0200 Subject: [PATCH] alternative 1 for issue #155, support for python<3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5f0be14f..fb2b97a2 100755 --- a/setup.py +++ b/setup.py @@ -431,9 +431,13 @@ class Setup(): if fileout is not None: fileout.close() if filein is not None: filein .close() print('Creating uncompressed zip file ponysay.zip with files from src: ' + ' '.join(ponysaysrc)) - with ZipFile('ponysay.zip', 'w') as myzip: + myzip = None + try: + myzip = ZipFile('ponysay.zip', 'w') for src in ponysaysrc: myzip.write('src/%s.install' % src, src) + finally: + myzip.close() os.chmod('ponysay.zip', 0o755) try: fileout = open('ponysay.install', 'wb+')