Revision 0cf257c5 lib/locking.py

b/lib/locking.py
331 331
    result after releasing the lock.
332 332

  
333 333
    """
334
    return set(self.__lockdict.keys())
334
    return self.__lockdict.keys()
335 335

  
336 336
  def _names(self):
337 337
    """Return a copy of the current set of elements.
......
343 343
      result = self.__names()
344 344
    finally:
345 345
      self.__lock.release()
346
    return result
346
    return set(result)
347 347

  
348 348
  def acquire(self, names, blocking=1, shared=0):
349 349
    """Acquire a set of resource locks.
......
467 467
    # conflicting add()
468 468
    self.__lock.acquire()
469 469
    try:
470
      invalid_names = self.__names().intersection(names)
470
      invalid_names = set(self.__names()).intersection(names)
471 471
      if invalid_names:
472 472
        # This must be an explicit raise, not an assert, because assert is
473 473
        # turned off when using optimization, and this can happen because of

Also available in: Unified diff