File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -268,11 +268,6 @@ def __exit__(self, *args):
268
268
os .chdir (self .previous_cwd )
269
269
270
270
271
- def safe_mkdir (path ):
272
- if not os .path .exists (path ):
273
- os .makedirs (path )
274
-
275
-
276
271
def version_key (element ):
277
272
fields = list (element .split ("." ))
278
273
if len (fields ) == 1 :
@@ -560,7 +555,7 @@ def __str__(self):
560
555
561
556
def save (self , path ):
562
557
dirname = os .path .dirname (path )
563
- safe_mkdir (dirname )
558
+ os . makedirs (dirname , exist_ok = True )
564
559
565
560
text = str (self )
566
561
with open (path , "wt" , encoding = "utf-8" ) as file :
@@ -1178,12 +1173,12 @@ def populate():
1178
1173
Creates and populates the Misc/NEWS.d directory tree.
1179
1174
"""
1180
1175
os .chdir ("Misc" )
1181
- safe_mkdir ("NEWS.d/next" )
1176
+ os . makedirs ("NEWS.d/next" , exist_ok = True )
1182
1177
1183
1178
for section in sections :
1184
1179
dir_name = sanitize_section (section )
1185
1180
dir_path = f"NEWS.d/next/{ dir_name } "
1186
- safe_mkdir (dir_path )
1181
+ os . makedirs (dir_path , exist_ok = True )
1187
1182
readme_path = f"NEWS.d/next/{ dir_name } /README.rst"
1188
1183
with open (readme_path , "wt" , encoding = "utf-8" ) as readme :
1189
1184
readme .write (f"Put news entry ``blurb`` files for the *{ section } * section in this directory.\n " )
You can’t perform that action at this time.
0 commit comments