Revision cdb08f44 lib/locking.py

b/lib/locking.py
93 93
    """
94 94
    self.__lock.acquire()
95 95
    try:
96
      result = self.__is_owned(shared)
96
      result = self.__is_owned(shared=shared)
97 97
    finally:
98 98
      self.__lock.release()
99 99

  
100 100
    return result
101 101

  
102
  def __wait(self,c):
102
  def __wait(self, c):
103 103
    """Wait on the given condition, and raise an exception if the current lock
104 104
    is declared deleted in the meantime.
105 105

  
......
133 133
    finally:
134 134
      self.__nwait_exc -= 1
135 135

  
136

  
137 136
  def acquire(self, blocking=1, shared=0):
138 137
    """Acquire a shared lock.
139 138

  
......
210 209

  
211 210
        # If there are shared holders waiting there *must* be an exclusive holder
212 211
        # waiting as well; otherwise what were they waiting for?
213
        assert (self.__nwait_shr == 0 or self.__nwait_exc > 0,
214
                "Lock sharers waiting while no exclusive is queueing")
212
        assert self.__nwait_shr == 0 or self.__nwait_exc > 0, \
213
               "Lock sharers waiting while no exclusive is queueing"
215 214

  
216 215
        # If there are no more shared holders and some exclusive holders are
217 216
        # waiting let's wake one up.
......
337 336
    """Return a copy of the current set of elements.
338 337

  
339 338
    Used only for debugging purposes.
339

  
340 340
    """
341 341
    self.__lock.acquire(shared=1)
342 342
    try:
......
460 460
             (defaults to all the locks acquired at that level).
461 461

  
462 462
    """
463

  
464 463
    assert self._is_owned(), "release() on lock set while not owner"
465 464

  
466 465
    # Support passing in a single resource to release rather than many
......
812 811
    assert self._is_owned(level) or not self._upper_owned(level), (
813 812
           "Cannot remove locks at a level while not owning it or"
814 813
           " owning some at a greater one")
815
    return self.__keyring[level].remove(names, blocking)
816

  
814
    return self.__keyring[level].remove(names, blocking=blocking)

Also available in: Unified diff