Skip to content

Commit

Permalink
strip color codes
Browse files Browse the repository at this point in the history
  • Loading branch information
pefoley2 committed Feb 8, 2016
1 parent ea36714 commit 6631c56
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cslbot/helpers/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ def do_pull(srcdir=None, repo=None):
else:
proc = subprocess.run(['pip', 'install', '--no-deps', '-U', 'git+git://github.com/%s' % repo], stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
env=os.environ.copy(), universal_newlines=True, check=True)
return proc.stdout.splitlines()[-1]
output = proc.stdout.splitlines()[-1]
# Strip ascii color codes
return re.sub(r'\x1b[^m]*h', '', output)
except subprocess.CalledProcessError as e:
for line in e.output.decode().splitlines():
logging.error(line)
Expand Down

0 comments on commit 6631c56

Please sign in to comment.