mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-03 03:36:44 +00:00
Add unit test and make corrections to make_dirs_with_absolute_mode
This commit is contained in:
parent
ee44732d03
commit
ba35d7262b
@ -179,13 +179,13 @@ def make_dirs_with_absolute_mode(parent, dirname, mode,):
|
||||
make_dirs(dirname)
|
||||
os.chmod(dirname, mode)
|
||||
initial, last = os.path.split(dirname)
|
||||
if initial == os.path.abspath(parent):
|
||||
os.chmod(initial, mode)
|
||||
else:
|
||||
if os.path.abspath(initial) == os.path.abspath(parent):
|
||||
return
|
||||
while initial and initial != os.path.abspath(parent):
|
||||
else:
|
||||
os.chmod(initial, mode)
|
||||
while initial and os.path.abspath(initial) != os.path.abspath(parent):
|
||||
initial, last = os.path.split(initial)
|
||||
if initial == os.path.abspath(parent):
|
||||
if os.path.abspath(initial) == os.path.abspath(parent):
|
||||
break
|
||||
else:
|
||||
os.chmod(initial, mode)
|
||||
|
Loading…
Reference in New Issue
Block a user