From aef7e95b05dc37295b7d239ed27e9fa22f76cab6 Mon Sep 17 00:00:00 2001 From: tfmoraes Date: Wed, 13 Jan 2010 16:33:32 +0000 Subject: [PATCH] FIX: Remove a temporary file already removed raises a OSError in Linux, like related in #104. Encapsulate between a try ... except --- invesalius/data/surface.py | 6 ++++++ 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/invesalius/data/surface.py b/invesalius/data/surface.py index 0ffc0fc..a1eb2c7 100644 --- a/invesalius/data/surface.py +++ b/invesalius/data/surface.py @@ -266,6 +266,12 @@ class SurfaceManager(): os.remove(filename_polydata) except (WindowsError): print "Error while removing surface temporary file" + if sys.platform == 'linux2': + try: + os.remove(filename_img) + os.remove(filename_polydata) + except (OSError): + print "Error while removing surface temporary file" else: os.remove(filename_img) os.remove(filename_polydata) -- libgit2 0.21.2