diff --git a/lib/logitech_receiver/base.py b/lib/logitech_receiver/base.py index b7e7527b..8bf6506c 100644 --- a/lib/logitech_receiver/base.py +++ b/lib/logitech_receiver/base.py @@ -360,11 +360,11 @@ handles_lock = {} def handle_lock(handle): with request_lock: - if handles_lock.get(int(handle)) is None: + if handles_lock.get(handle) is None: if _log.isEnabledFor(_INFO): - _log.info('New lock %s', int(handle)) - handles_lock[int(handle)] = _threading.Lock() # Serialize requests on the handle - return handles_lock[int(handle)] + _log.info('New lock %s', repr(handle)) + handles_lock[handle] = _threading.Lock() # Serialize requests on the handle + return handles_lock[handle] # context manager for locks with a timeout