in src/aws_encryption_sdk_cli/internal/metadata.py [0:0]
def close(self):
# type: () -> None
"""Flush and close the output stream."""
if self._output_stream is not None:
self._output_stream.flush()
if self._output_stream is not sys.stdout:
self._output_stream.close()
# Since we re-use each instance of this in a single call, we only want to overwrite
# the first time if we are overwriting.
if self.output_file != "-":
self._output_mode = "ab"