MCPcopy Create free account
hub / github.com/ipython/traitlets / __exit__

Method __exit__

traitlets/config/loader.py:595–605  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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
608class PyFileConfigLoader(FileConfigLoader):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected