Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 32ffaef

Browse files
authored
Merge pull request #13214 from Kojoley/ipexec-pycharm-qol-fix
ipexec: prevent output coloring under PyCharm
2 parents 32497c8 + b5dc5d7 commit 32ffaef

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

IPython/testing/tools.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ def ipexec(fname, options=None, commands=()):
205205
# should we keep suppressing warnings here, even after removing shims?
206206
env['PYTHONWARNINGS'] = 'ignore'
207207
# env.pop('PYTHONWARNINGS', None) # Avoid extraneous warnings appearing on stderr
208+
# Prevent coloring under PyCharm ("\x1b[0m" at the end of the stdout)
209+
env.pop("PYCHARM_HOSTED", None)
208210
for k, v in env.items():
209211
# Debug a bizarre failure we've seen on Windows:
210212
# TypeError: environment can only contain strings

0 commit comments

Comments
 (0)