def __exit__(self, exc_type, exc_value, traceback): """Clean up everything.""" if exc_type is None: utils.raise_if_process_errored(self.process, DownloadError) # Make sure to terminate the process try: self.process.terminate() except OSError: # Already stopped pass
def __exit__(self, exc_type, exc_value, traceback): """Clean up everything.""" if exc_type is None: utils.raise_if_process_errored(self.process, DownloadError) # Make sure to terminate the process try: self.process.terminate() except OSError: # Already stopped pass
def __exit__(self, exc_type, exc_value, traceback): """Clean up everything.""" if exc_type is not None: return False if hasattr(self, 'process'): try: self.process.terminate() except OSError: # Already stopped pass utils.raise_if_process_errored(self.process, BackupError) return True
def __exit__(self, exc_type, exc_value, traceback): """Clean up everything.""" if exc_type is not None: return False if hasattr(self, 'process'): try: self.process.terminate() except OSError: # Already stopped pass utils.raise_if_process_errored(self.process, BackupError) return True