projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
25262e2
)
AsynchronousLock: assert state in unlock()
author
Zac Medico
<zmedico@gentoo.org>
Fri, 22 Oct 2010 18:40:23 +0000
(11:40 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Fri, 22 Oct 2010 18:40:23 +0000
(11:40 -0700)
pym/_emerge/AsynchronousLock.py
patch
|
blob
|
history
diff --git
a/pym/_emerge/AsynchronousLock.py
b/pym/_emerge/AsynchronousLock.py
index d72add4f1a421fcef7b4889f03b9682d8b611598..53fbd22d22147ef9c02032f690d28f6c3edc7566 100644
(file)
--- a/
pym/_emerge/AsynchronousLock.py
+++ b/
pym/_emerge/AsynchronousLock.py
@@
-126,6
+126,8
@@
class _LockThread(AbstractPollTask):
def unlock(self):
if self.lock_obj is None:
raise AssertionError('not locked')
+ if self.returncode is None:
+ raise AssertionError('lock not acquired yet')
unlockfile(self.lock_obj)
self.lock_obj = None
@@
-217,6
+219,8
@@
class _LockProcess(AbstractPollTask):
def unlock(self):
if self._proc is None:
raise AssertionError('not locked')
+ if self.returncode is None:
+ raise AssertionError('lock not acquired yet')
self._files['pipe_out'].write(b'\0')
self._files['pipe_out'].close()
self._files = None