| 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() |
no outgoing calls
searching dependent graphs…