From e6abd77c963fe7325ef1aaa45d50f51246e871f6 Mon Sep 17 00:00:00 2001 From: Ryan Petrello Date: Fri, 22 Mar 2019 08:47:18 -0400 Subject: [PATCH] remove py2 compatability from awx.main.expect.run this module is no longer run on isolated nodes (they use runner now) --- awx/main/expect/run.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/awx/main/expect/run.py b/awx/main/expect/run.py index f255bbc477..75a6247ec7 100755 --- a/awx/main/expect/run.py +++ b/awx/main/expect/run.py @@ -14,10 +14,7 @@ import signal import sys import threading import time -try: - from io import StringIO -except ImportError: - from StringIO import StringIO +from io import StringIO import pexpect import psutil @@ -231,10 +228,7 @@ def handle_termination(pid, args, proot_cmd, is_cancel=True): instance's cancel_flag. ''' try: - if sys.version_info > (3, 0): - used_proot = proot_cmd.encode('utf-8') in args - else: - used_proot = proot_cmd in ' '.join(args) + used_proot = proot_cmd.encode('utf-8') in args if used_proot: if not psutil: os.kill(pid, signal.SIGKILL)