alternative 1 for issue #155, support for python<3.2

Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
Mattias Andrée 2013-04-06 20:35:31 +02:00
parent b0b41976c3
commit 992e80d400

View file

@ -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+')