Fixing white space, adding try/except block, and specifying permissions without stat.

This commit is contained in:
Rob 2020-05-19 12:41:32 -07:00
parent bf4361ae92
commit ac6256f9a0

View File

@ -1836,17 +1836,12 @@ def write_json_file(obj, fn):
os.unlink(fn)
except OSError:
pass
mask = os.umask(0)
os.umask(mask)
os.chmod(tf.name,
(stat.S_IRUSR
| stat.S_IWUSR
| stat.S_IRGRP
| stat.S_IWGRP
| stat.S_IROTH
| stat.S_IWOTH)
& ~mask)
try:
mask = os.umask(0)
os.umask(mask)
os.chmod(tf.name, 0o666 & ~mask)
except OSError:
pass
os.rename(tf.name, fn)
except Exception:
try: