Exit the context manager but do not handle any errors. In case of any error, we do not want to write the potentially broken configuration to disk.
(self, exc_type: object, exc_value: object, traceback: object)
| 593 | return self.config |
| 594 | |
| 595 | def __exit__(self, exc_type: object, exc_value: object, traceback: object) -> None: |
| 596 | """ |
| 597 | Exit the context manager but do not handle any errors. |
| 598 | |
| 599 | In case of any error, we do not want to write the potentially broken |
| 600 | configuration to disk. |
| 601 | """ |
| 602 | self.config.version = 1 |
| 603 | json_config = json.dumps(self.config, indent=2) |
| 604 | with open(self.full_filename, "w") as f: |
| 605 | f.write(json_config) |
| 606 | |
| 607 | |
| 608 | class PyFileConfigLoader(FileConfigLoader): |
nothing calls this directly
no outgoing calls
no test coverage detected