Use os.path.dirname instead of split and rename var to initial_path_u

This commit is contained in:
David Stainton 2016-02-15 13:13:07 +01:00 committed by Brian Warner
parent cd390b90e4
commit 2963e9e50c

View File

@ -593,8 +593,8 @@ class WriteFileMixin(object):
if now is None: if now is None:
now = time.time() now = time.time()
initial, last = os.path.split(abspath_u) initial_path_u = os.path.dirname(abspath_u)
fileutil.make_dirs_with_absolute_mode(local_path_u, initial, (~ self._umask) & 0777) fileutil.make_dirs_with_absolute_mode(local_path_u, initial_path_u, (~ self._umask) & 0777)
fileutil.write(replacement_path_u, file_contents) fileutil.write(replacement_path_u, file_contents)
os.chmod(replacement_path_u, (~ self._umask) & 0777) os.chmod(replacement_path_u, (~ self._umask) & 0777)