Commit 098ba4d00be2d7fce29cb7e327c0664f815e5f5c
1 parent
6a82b017
Exists in
master
and in
68 other branches
FIX: Error remove temp file
Showing
1 changed file
with
7 additions
and
4 deletions
Show diff stats
invesalius/data/surface.py
@@ -360,10 +360,13 @@ class SurfaceManager(): | @@ -360,10 +360,13 @@ class SurfaceManager(): | ||
360 | actor.GetProperty().SetColor(colour) | 360 | actor.GetProperty().SetColor(colour) |
361 | actor.GetProperty().SetOpacity(1-surface.transparency) | 361 | actor.GetProperty().SetOpacity(1-surface.transparency) |
362 | 362 | ||
363 | - #Remove all temp file | ||
364 | - os.remove(filename_img) | ||
365 | - os.remove(filename_polydata) | ||
366 | - | 363 | + try: |
364 | + #Remove all temp file | ||
365 | + os.remove(filename_img) | ||
366 | + os.remove(filename_polydata) | ||
367 | + except(WindowsError): | ||
368 | + print "Error remove temp file" | ||
369 | + | ||
367 | # Append surface into Project.surface_dict | 370 | # Append surface into Project.surface_dict |
368 | proj = prj.Project() | 371 | proj = prj.Project() |
369 | index = proj.AddSurface(surface) | 372 | index = proj.AddSurface(surface) |