MCPcopy Index your code
hub / github.com/python/cpython / _OurHandler

Class _OurHandler

Lib/test/test_logging.py:755–763  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

753 def test_post_fork_child_no_deadlock(self):
754 """Ensure child logging locks are not held; bpo-6721 & bpo-36533."""
755 class _OurHandler(logging.Handler):
756 def __init__(self):
757 super().__init__()
758 self.sub_handler = logging.StreamHandler(
759 stream=open('/dev/null', 'wt', encoding='utf-8'))
760
761 def emit(self, record):
762 with self.sub_handler.lock:
763 self.sub_handler.emit(record)
764
765 self.assertEqual(len(logging._handlers), 0)
766 refed_h = _OurHandler()

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…