fixed python 2.4 compatibility

nf=tempfile.NamedTemporaryFile(delete=False)
TypeError: NamedTemporaryFile() got an unexpected keyword argument 'delete'
reviewable/pr18780/r1
colynn.liu 9 years ago
parent e8427cb32a
commit 9b981cecc6

@ -243,11 +243,16 @@ def main():
nf.write(new_limit) nf.write(new_limit)
f.close() f.close()
nf.close() nf.flush()
# Copy tempfile to newfile # Copy tempfile to newfile
module.atomic_move(nf.name, f.name) module.atomic_move(nf.name, f.name)
try:
nf.close()
except:
pass
res_args = dict( res_args = dict(
changed = changed, msg = message changed = changed, msg = message
) )

Loading…
Cancel
Save