Commit 432285db authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: os.get_terminal_width might error in non-interactive envs, use raw string

for regexp
parent 967aae3c
......@@ -701,8 +701,10 @@ class Progress(object):
# os.get_terminal_size added in python
# 3.3, so we try it but fall back to tput
if hasattr(os, 'get_terminal_size'):
return os.get_terminal_size()[0]
except Exception:
result = sp.check_output(('tput', 'cols'))
......@@ -156,4 +156,4 @@ def mock_input(*responses):
def strip_ansi_escape_sequences(text):
"""Does what function name says it does. """
return re.sub('\x1b\[[0-9;]*m', '', text)
return re.sub(r'\x1b\[[0-9;]*m', '', text)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment