From: Zac Medico Date: Fri, 22 Oct 2010 18:44:00 +0000 (-0700) Subject: Make _LockThread.lock_obj private. X-Git-Tag: v2.2.0_alpha1~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8115a6ee3a88badf155953fed12043556f3dd61f;p=portage.git Make _LockThread.lock_obj private. --- diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py index 53fbd22d2..3fe0e9747 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -84,8 +84,8 @@ class _LockThread(AbstractPollTask): (before the start() method returns). """ - __slots__ = ('lock_obj', 'path',) + \ - ('_files', '_force_dummy', + __slots__ = ('path',) + \ + ('_files', '_force_dummy', '_lock_obj', '_thread', '_reg_id',) def _start(self): @@ -106,7 +106,7 @@ class _LockThread(AbstractPollTask): self._thread.start() def _run_lock(self): - self.lock_obj = lockfile(self.path, wantnewlockfile=True) + self._lock_obj = lockfile(self.path, wantnewlockfile=True) self._files['pipe_write'].write(b'\0') def _output_handler(self, f, event): @@ -124,12 +124,12 @@ class _LockThread(AbstractPollTask): return self.returncode def unlock(self): - if self.lock_obj is None: + 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 + unlockfile(self._lock_obj) + self._lock_obj = None def _unregister(self): self._registered = False