Rewrite try: except: finally: so it is python 2.4 friendly

This commit is contained in:
Christian Dywan 2009-01-05 22:08:52 +01:00
parent aebd813c68
commit 25e07232ac

23
wscript
View file

@ -287,17 +287,18 @@ def build (bld):
pre = open (desktop + '.in') pre = open (desktop + '.in')
after = open (folder + '/' + desktop, 'w') after = open (folder + '/' + desktop, 'w')
try: try:
for line in pre: try:
if line != '': for line in pre:
if line[0] == '_': if line != '':
after.write (line[1:]) if line[0] == '_':
else: after.write (line[1:])
after.write (line) else:
after.close () after.write (line)
Utils.pprint ('BLUE', desktop + '.in -> ' + desktop) after.close ()
install_files ('DATADIR', 'applications', folder + '/' + desktop) Utils.pprint ('BLUE', desktop + '.in -> ' + desktop)
except: install_files ('DATADIR', 'applications', folder + '/' + desktop)
Utils.pprint ('BLUE', 'File ' + desktop + ' not generated') except:
Utils.pprint ('BLUE', 'File ' + desktop + ' not generated')
finally: finally:
pre.close () pre.close ()