Rewrite try: except: finally: so it is python 2.4 friendly
This commit is contained in:
parent
aebd813c68
commit
25e07232ac
1 changed files with 12 additions and 11 deletions
23
wscript
23
wscript
|
@ -287,17 +287,18 @@ def build (bld):
|
|||
pre = open (desktop + '.in')
|
||||
after = open (folder + '/' + desktop, 'w')
|
||||
try:
|
||||
for line in pre:
|
||||
if line != '':
|
||||
if line[0] == '_':
|
||||
after.write (line[1:])
|
||||
else:
|
||||
after.write (line)
|
||||
after.close ()
|
||||
Utils.pprint ('BLUE', desktop + '.in -> ' + desktop)
|
||||
install_files ('DATADIR', 'applications', folder + '/' + desktop)
|
||||
except:
|
||||
Utils.pprint ('BLUE', 'File ' + desktop + ' not generated')
|
||||
try:
|
||||
for line in pre:
|
||||
if line != '':
|
||||
if line[0] == '_':
|
||||
after.write (line[1:])
|
||||
else:
|
||||
after.write (line)
|
||||
after.close ()
|
||||
Utils.pprint ('BLUE', desktop + '.in -> ' + desktop)
|
||||
install_files ('DATADIR', 'applications', folder + '/' + desktop)
|
||||
except:
|
||||
Utils.pprint ('BLUE', 'File ' + desktop + ' not generated')
|
||||
finally:
|
||||
pre.close ()
|
||||
|
||||
|
|
Loading…
Reference in a new issue