fixes in write_when_new
- create files with g/o read - fix superfluos remove of tmpfile
This commit is contained in:
@ -248,8 +248,6 @@ def pip():
|
||||
os.rename(tmpname, filename)
|
||||
else:
|
||||
os.remove(tmpname)
|
||||
else:
|
||||
os.remove(tmpname)
|
||||
else:
|
||||
print(pipcmd)
|
||||
# unix_cmd(pipcmd, doit, stdout=None)
|
||||
@ -290,6 +288,7 @@ def write_when_new(filename, content, as_root=False, ignore_reduction=False):
|
||||
fil.write(content)
|
||||
fil.flush()
|
||||
unix_cmd('cp', fil.name, filename, sudo=as_root)
|
||||
unix_cmd('chmod 0644', filename, sudo=as_root)
|
||||
else:
|
||||
unix_cmd('rm', '-f', filename, sudo=as_root)
|
||||
elif more_info:
|
||||
|
Reference in New Issue
Block a user