Commits

Jason R. Coombs committed d77ee97

Add 'remove' method to lockfile, to attempt to remove the lockfile, usually after unlocking it. This fixes a failing test that asserts the lockfiles have been removed.

Comments (0)

Files changed (2)

cherrypy/lib/lockfile.py

     def release(self):
         os.remove(self.path)
 
+    def remove(self):
+        pass
+
 
 class SystemLockFile(object):
     """
         self.fp.close()
         del self.fp
 
+    def remove(self):
+        """
+        Attempt to remove the file
+        """
+        try:
+            os.remove(self.path)
+        except:
+            pass
+
     #@abc.abstract_method
     #def _lock_file(self):
     #    """Attempt to obtain the lock on self.fp. Raise LockError if not

cherrypy/lib/sessions.py

             path = self._get_file_path()
         path += self.LOCK_SUFFIX
 
-        self.locks.pop(path).release()
+        lock = self.locks.pop(path)
+        lock.release()
+        lock.remove()
+
         self.locked = False
 
     def clean_up(self):