File tree Expand file tree Collapse file tree 1 file changed +2
-13
lines changed
Expand file tree Collapse file tree 1 file changed +2
-13
lines changed Original file line number Diff line number Diff line change @@ -679,27 +679,16 @@ def make_executable(name):
679679
680680
681681def make_dir_writeable (dirname ):
682- # Ensure all files are readable and writable by the current user.
683- permission_bits = stat .S_IWRITE | stat .S_IREAD
684-
685- def is_writable (path ):
686- return (os .stat (path ).st_mode & permission_bits ) != permission_bits
687-
688- def make_writable (path ):
689- new_mode = os .stat (path ).st_mode | permission_bits
690- os .chmod (path , new_mode )
691-
692682 # Some tests make files and subdirectories read-only, so rmtree/unlink will not delete
693683 # them. Force-make everything writable in the subdirectory to make it
694684 # removable and re-attempt.
695- if not is_writable (dirname ):
696- make_writable (dirname )
685+ os .chmod (dirname , 0o777 )
697686
698687 for directory , subdirs , files in os .walk (dirname ):
699688 for item in files + subdirs :
700689 i = os .path .join (directory , item )
701690 if not os .path .islink (i ):
702- make_writable ( i )
691+ os . chmod ( i , 0o777 )
703692
704693
705694def force_delete_dir (dirname ):
You can’t perform that action at this time.
0 commit comments