(self)
| 136 | atexit.unregister(func) |
| 137 | |
| 138 | def test_eq_unregister_clear(self): |
| 139 | # Issue #112127: callback's __eq__ may call unregister or _clear |
| 140 | class Evil: |
| 141 | def __eq__(self, other): |
| 142 | action(other) |
| 143 | return NotImplemented |
| 144 | |
| 145 | for action in atexit.unregister, lambda o: atexit._clear(): |
| 146 | with self.subTest(action=action): |
| 147 | atexit.register(lambda: None) |
| 148 | atexit.unregister(Evil()) |
| 149 | atexit._clear() |
| 150 | |
| 151 | def test_eq_unregister(self): |
| 152 | # Issue #112127: callback's __eq__ may call unregister |
nothing calls this directly
no test coverage detected