code cleanup: unused macros
[blender.git] / source / tests / batch_import.py
index 5c228c014cae29d05ca0c9224ee3f09fc82f56a2..a2c5fb5905566c22e6fbd8bdb2483574dc85827c 100644 (file)
@@ -63,12 +63,12 @@ def clear_scene():
 
 
 def batch_import(operator="",
-                   path="",
-                   save_path="",
-                   match="",
-                   start=0,
-                   end=sys.maxsize,
-                   ):
+                 path="",
+                 save_path="",
+                 match="",
+                 start=0,
+                 end=sys.maxsize,
+                 ):
     import addon_utils
     _reset_all = addon_utils.reset_all  # XXX, hack
 
@@ -112,7 +112,7 @@ def batch_import(operator="",
     for i, f in enumerate(files):
         print("    %s(filepath=%r) # %d of %d" % (operator, f, i + start, len(files)))
 
-        # hack so loading the new file doesnt undo our loaded addons
+        # hack so loading the new file doesn't undo our loaded addons
         addon_utils.reset_all = lambda: None  # XXX, hack
 
         bpy.ops.wm.read_factory_settings()
@@ -134,8 +134,7 @@ def batch_import(operator="",
             print("\tSaving: %r" % fout_blend)
 
             fout_dir = os.path.dirname(fout_blend)
-            if not os.path.exists(fout_dir):
-                os.makedirs(fout_dir)
+            os.makedirs(fout_dir, exist_ok=True)
 
             bpy.ops.wm.save_as_mainfile(filepath=fout_blend)