python: Use universal_newlines to get str from subprocess.

We can replace ‘universal_newlines’ with ‘text’ when we bump our
minimum Python version to 3.7.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-10-29 17:36:18 -07:00
committed by Tim Abbott
parent 9281dccae4
commit aaa7b766d8
12 changed files with 35 additions and 38 deletions

View File

@@ -63,7 +63,7 @@ def test_generated_curl_examples_for_success(client: Client) -> None:
try:
# We split this across two lines so if curl fails and
# returns non-JSON output, we'll still print it.
response_json = subprocess.check_output(generated_curl_command).decode('utf-8')
response_json = subprocess.check_output(generated_curl_command, universal_newlines=True)
response = json.loads(response_json)
assert(response["result"] == "success")
except (AssertionError, Exception):