From 598d16671e0a15476c3aea8fc024c830dc0943b8 Mon Sep 17 00:00:00 2001 From: Holger Frey Date: Wed, 7 Aug 2019 14:33:09 +0200 Subject: [PATCH] make call() python 3.6 compatible --- zfs-snapshot-backup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zfs-snapshot-backup.py b/zfs-snapshot-backup.py index 1e51db4..38a1869 100644 --- a/zfs-snapshot-backup.py +++ b/zfs-snapshot-backup.py @@ -13,9 +13,9 @@ ZFS_ELAB_PREFIX = "elabfs-" TMP_BACKUP_FOLDER = "/mnt/Datenspeicher/snap-backup-dataset/temporary-backups" -def call(arguments): +def call(arguments, as_text=False): result = subprocess.run( - arguments, check=True, capture_output=True, text=True + arguments, check=True, stdout=subprocess.PIPE, universal_newlines=as_text ) return result.stdout @@ -23,7 +23,7 @@ def call(arguments): def remote_call(arguments): cmd = ["ssh", "-i", SSH_KEY_FILE, SSH_REMOTE] cmd.extend(arguments) - return call(cmd) + return call(cmd, as_text=True) def clean_split(text):