web/views/__init__.py
branch3.5
changeset 3145 9b28545de60d
parent 3122 0e49d2679c5c
child 3451 6b46d73823f5
child 3689 deb13e88e037
--- a/web/views/__init__.py	Wed Sep 09 15:12:42 2009 +0200
+++ b/web/views/__init__.py	Wed Sep 09 17:45:34 2009 +0200
@@ -111,13 +111,8 @@
 
     def cell_call(self, row=0, col=0):
         self.row, self.col = row, col # in case one needs it
-        _, tmpfile = tempfile.mkstemp('.png')
-        try:
-            self._generate(tmpfile)
-            self.w(open(tmpfile, 'rb').read())
-        finally:
-            try:
-                os.unlink(tmpfile)
-            except Exception, ex:
-                if sys.platform != 'win32':
-                      self.warning("can't delete %s : %s" % (tmpfile, ex))
+        fd, tmpfile = tempfile.mkstemp('.png')
+        os.close(fd)
+        self._generate(tmpfile)
+        self.w(open(tmpfile, 'rb').read())
+        os.unlink(tmpfile)