def _finish(self, forced=False):
if hasattr(self, "<STR_LIT>") and self._current_file_handle:<EOL><INDENT>self._current_file_handle.close()<EOL><DEDENT>if self._current_deferred:<EOL><INDENT>self._current_deferred.callback(self._sent)<EOL>self._current_deferred = None<EOL><DEDENT>if not forced and self._deferred:<EOL><INDENT>self._deferred.callback(self._sent)<EOL><DEDENT>
Cleanup code after asked to stop producing.

        Kwargs:
            forced (bool): If True, we were forced to stop