Close the handler and the temporary log file. The temporary log file is deleted if it wasn't used.
(self)
| 284 | super().emit(record) |
| 285 | |
| 286 | def close(self) -> None: |
| 287 | """Close the handler and the temporary log file. |
| 288 | |
| 289 | The temporary log file is deleted if it wasn't used. |
| 290 | |
| 291 | """ |
| 292 | self.acquire() |
| 293 | try: |
| 294 | # StreamHandler.close() doesn't close the stream to allow a |
| 295 | # stream like stderr to be used |
| 296 | self.stream.close() |
| 297 | if self._delete: |
| 298 | shutil.rmtree(self._workdir) |
| 299 | self._delete = False |
| 300 | super().close() |
| 301 | finally: |
| 302 | self.release() |
| 303 | |
| 304 | |
| 305 | def pre_arg_parse_except_hook(memory_handler: MemoryHandler, |