diff --git a/infinitepush/backupcommands.py b/infinitepush/backupcommands.py --- a/infinitepush/backupcommands.py +++ b/infinitepush/backupcommands.py @@ -446,8 +446,9 @@ ui.status(_('nothing to backup\n')) finally: # cleanup ensures that all pipes are flushed + cleanup = getattr(other, '_cleanup', None) or getattr(other, 'cleanup') try: - other.cleanup() + cleanup() except Exception: ui.warn(_('remote connection cleanup failed\n')) ui.status(_('finished in %f seconds\n') % (time.time() - start))