From 70800911775cc370c04559f0e9975f866d1610fe Mon Sep 17 00:00:00 2001 From: kpetersn Date: Mon, 15 Jun 2020 16:54:09 -0500 Subject: [PATCH] Use subprocess.call instead of subprocess.run on older versions of python --- .ci-local/travis/post-prepare.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.ci-local/travis/post-prepare.py b/.ci-local/travis/post-prepare.py index f242980c..9561f37c 100755 --- a/.ci-local/travis/post-prepare.py +++ b/.ci-local/travis/post-prepare.py @@ -1,10 +1,14 @@ #!/usr/bin/env python import os +import sys import subprocess # Comment out SUPPORT from motor's RELEASE file -status = subprocess.run(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './configure/RELEASE']) +if sys.version_info >= (3, 5): + status = subprocess.run(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './configure/RELEASE']) +else: + status = subprocess.call(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './configure/RELEASE']) # print("{}Updated motor/configure/RELEASE{}".format(ANSI_BLUE, ANSI_RESET)) #!grep SUPPORT ./configure/RELEASE || : @@ -12,7 +16,10 @@ os.system('cat ./configure/RELEASE') print("{}End of updated motor/configure/RELEASE{}".format(ANSI_BLUE, ANSI_RESET)) # Comment out SUPPORT from motorOms's RELEASE file -status = subprocess.run(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './modules/motorOms/configure/RELEASE']) +if sys.version_info >= (3, 5): + status = subprocess.run(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './modules/motorOms/configure/RELEASE']) +else: + status = subprocess.call(['sed', '-i', '-e', "s|^\(SUPPORT=.*\)$|#\1|g", './modules/motorOms/configure/RELEASE']) # print("{}Updated motor/modules/motorOms/configure/RELEASE{}".format(ANSI_BLUE, ANSI_RESET)) #!grep SUPPORT ./modules/motorOms/configure/RELEASE || :