Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
FSL
conda
installer
Commits
432285db
Commit
432285db
authored
Jul 15, 2021
by
Paul McCarthy
🚵
Browse files
BF: os.get_terminal_width might error in non-interactive envs, use raw string
for regexp
parent
967aae3c
Changes
2
Show whitespace changes
Inline
Side-by-side
fslinstaller.py
View file @
432285db
...
...
@@ -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'
)
:
try
:
return
os
.
get_terminal_size
()[
0
]
except
Exception
:
pass
try
:
result
=
sp
.
check_output
((
'tput'
,
'cols'
))
...
...
test/__init__.py
View file @
432285db
...
...
@@ -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
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment