py api: path_reference_copy() use try/except when copying images, can fail for odd...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 10 Apr 2013 12:16:27 +0000 (12:16 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 10 Apr 2013 12:16:27 +0000 (12:16 +0000)
release/scripts/modules/bpy_extras/io_utils.py

index dfb6c46..eeaa640 100644 (file)
@@ -436,8 +436,18 @@ def path_reference_copy(copy_set, report=print):
             pass
         else:
             dir_to = os.path.dirname(file_dst)
-            os.makedirs(dir_to, exist_ok=True)
-            shutil.copy(file_src, file_dst)
+
+            try:
+                os.makedirs(dir_to, exist_ok=True)
+            except:
+                import traceback
+                traceback.print_exc()
+
+            try:
+                shutil.copy(file_src, file_dst)
+            except:
+                import traceback
+                traceback.print_exc()
 
 
 def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):