summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-02-25 19:16:15 +0000
committerLars Wirzenius <liw@liw.fi>2012-02-25 19:16:15 +0000
commit4bca0647d10dcee2073b2d23ab15d8bc855e7383 (patch)
treed4defb313d168272e1dcc0b8caa53912b76f68aa
parente7a033f59cace8e0cd17d0243b0628135f5fb2df (diff)
downloadobnam-4bca0647d10dcee2073b2d23ab15d8bc855e7383.tar.gz
Fix LockManager._sleep to not be given arguments
-rw-r--r--obnamlib/lockmgr.py2
-rw-r--r--obnamlib/lockmgr_tests.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/obnamlib/lockmgr.py b/obnamlib/lockmgr.py
index d57dd6af..d5fccba8 100644
--- a/obnamlib/lockmgr.py
+++ b/obnamlib/lockmgr.py
@@ -53,7 +53,7 @@ class LockManager(object):
raise obnamlib.LockFail()
else:
return
- self._sleep(1)
+ self._sleep()
def _unlock_one(self, dirname):
self._fs.unlock(self._lockname(dirname))
diff --git a/obnamlib/lockmgr_tests.py b/obnamlib/lockmgr_tests.py
index 2eef367b..83942d24 100644
--- a/obnamlib/lockmgr_tests.py
+++ b/obnamlib/lockmgr_tests.py
@@ -43,7 +43,7 @@ class LockManagerTests(unittest.TestCase):
self.now = 0
self.lm = obnamlib.LockManager(self.fs, self.timeout)
self.lm._time = self.fake_time
- self.lm._sleep = lambda s: None
+ self.lm._sleep = lambda: None
def tearDown(self):
shutil.rmtree(self.tempdir)
@@ -68,8 +68,7 @@ class LockManagerTests(unittest.TestCase):
def test_notices_when_preexisting_lock_goes_away(self):
self.lm.lock([self.dirnames[0]])
- self.lm._sleep = \
- lambda s: os.remove(self.lm._lockname(self.dirnames[0]))
+ self.lm._sleep = lambda: os.remove(self.lm._lockname(self.dirnames[0]))
self.lm.lock([self.dirnames[0]])
self.assertTrue(True)