<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def do_eos(self, _: argparse.Namespace) -> None: """Handle cleanup when a script has finished executing"""

        if self._script_dir:
            self._script_dir.pop()