(wr)
Remove a handler reference from the internal cleanup list.
Remove a handler reference from the internal cleanup list.
Remove a handler reference from the internal cleanup list .
def _removeHandlerRef(wr):
    """
    Remove a handler reference from the internal cleanup list.
    """
    # This function can be called during module teardown, when globals are
    # set to None. It can also be called from another thread. So we need to
    # pre-emptively grab the necessary globals and check if they're None,
    # to prevent race conditions and failures during interpreter shutdown.
    acquire, release, handlers = _acquireLock, _releaseLock, _handlerList
    if acquire and release and handlers:
        acquire()
        try:
            if wr in handlers:
                handlers.remove(wr)
        finally:
            release()
def _removeHandlerRef ( wr ) : # This function can be called during module teardown, when globals are # set to None. It can also be called from another thread. So we need to # pre-emptively grab the necessary globals and check if they're None, # to prevent race conditions and failures during interpreter shutdown. acquire , release , handlers = _acquireLock , _releaseLock , _handlerList if acquire and release and handlers : acquire ( ) try : if wr in handlers : handlers . remove ( wr ) finally : release ( )