Skip to content

Commit ef8349a

Browse files
author
Marcelo Vanzin
committed
Avoid check_output to make older python happy.
1 parent cef5136 commit ef8349a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

python/pyspark/tests.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,13 +2048,12 @@ def test_user_configuration(self):
20482048
|finally:
20492049
| sc.stop()
20502050
""")
2051-
try:
2052-
subprocess.check_output(
2053-
[self.sparkSubmit, "--master", "local", script],
2054-
stderr=subprocess.STDOUT)
2055-
except subprocess.CalledProcessError as e:
2056-
# This gives us a better error message for debugging.
2057-
self.fail("Test exited with {0}, output:\n{1}".format(e.returncode, e.output))
2051+
proc = subprocess.Popen(
2052+
[self.sparkSubmit, "--master", "local", script],
2053+
stdout=subprocess.PIPE,
2054+
stderr=subprocess.STDOUT)
2055+
out, err = proc.communicate()
2056+
self.assertEqual(0, proc.returncode, msg="Process failed with error:\n {0}".format(out))
20582057

20592058

20602059
class ContextTests(unittest.TestCase):

0 commit comments

Comments
 (0)