fixed python 2.4 compatibility
nf=tempfile.NamedTemporaryFile(delete=False) TypeError: NamedTemporaryFile() got an unexpected keyword argument 'delete'
This commit is contained in:
parent
e8427cb32a
commit
9b981cecc6
1 changed files with 6 additions and 1 deletions
|
@ -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…
Reference in a new issue