mirror of
https://github.com/vladmandic/automatic
synced 2026-09-18 16:54:33 +02:00
fix(queue): stop the queue lock from suppressing exceptions
Queue.__exit__ returned _queue_lock, and a truthy __exit__ return suppresses the exception in flight, so every `with queue_lock:` block discarded exceptions and resumed with locals from the aborted block unassigned. The bare threading.Lock it replaced returned None.
This commit is contained in:
@@ -25,7 +25,7 @@ class Queue:
|
||||
if _queue_debug:
|
||||
fn = f'{sys._getframe(3).f_code.co_name}:{sys._getframe(2).f_code.co_name}:{sys._getframe(1).f_code.co_name}' # pylint: disable=protected-access
|
||||
log.debug(f'Queue: unlock state={_queue_lock.locked()} fn={fn}')
|
||||
return _queue_lock
|
||||
# no return: a truthy __exit__ suppresses the exception in flight
|
||||
|
||||
|
||||
queue_lock = Queue() # public lock for external use
|
||||
|
||||
Reference in New Issue
Block a user