Skip to content

Commit dd29bcf

Browse files
author
y-p
committed
Merge pull request #5644 from y-p/PR_popen_noise_on_error
TST: prevent stderr from leaking to console in util.testing
2 parents a5a2c92 + 515cfd0 commit dd29bcf

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/util/testing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ def check_output(*popenargs, **kwargs): # shamelessly taken from Python 2.7 sou
145145
"""
146146
if 'stdout' in kwargs:
147147
raise ValueError('stdout argument not allowed, it will be overridden.')
148-
process = subprocess.Popen(stdout=subprocess.PIPE, *popenargs, **kwargs)
148+
process = subprocess.Popen(stdout=subprocess.PIPE,stderr=subprocess.PIPE,
149+
*popenargs, **kwargs)
149150
output, unused_err = process.communicate()
150151
retcode = process.poll()
151152
if retcode:
@@ -160,7 +161,7 @@ def _default_locale_getter():
160161
try:
161162
raw_locales = check_output(['locale -a'], shell=True)
162163
except subprocess.CalledProcessError as e:
163-
raise type(e)("%s, the 'locale -a' command cannot be foundon your "
164+
raise type(e)("%s, the 'locale -a' command cannot be found on your "
164165
"system" % e)
165166
return raw_locales
166167

0 commit comments

Comments
 (0)