summaryrefslogtreecommitdiff
path: root/testing/scripts/rust/exe_util.py
diff options
context:
space:
mode:
authorCronet Mainline Eng <cronet-mainline-eng+copybara@google.com>2023-05-26 12:04:12 -0800
committerPatrick Rohr <prohr@google.com>2023-05-30 11:26:09 -0700
commit6e619ff2daf1f025aed9c3b67a7492b4b858f981 (patch)
tree155ec8924ad6503a06c8b09c0d1ec7c6a764278d /testing/scripts/rust/exe_util.py
parenteddec18c18cdbcbdbbe9bf3c0fa24cb7f8d768ae (diff)
downloadcronet-6e619ff2daf1f025aed9c3b67a7492b4b858f981.tar.gz
Import Cronet version 114.0.5735.53
Project import generated by Copybara. FolderOrigin-RevId: /tmp/copybara-origin/src Test: none Change-Id: Ia2e49afefcd2e9ee2014009a31ac2d6786f86fbd
Diffstat (limited to 'testing/scripts/rust/exe_util.py')
-rw-r--r--testing/scripts/rust/exe_util.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/testing/scripts/rust/exe_util.py b/testing/scripts/rust/exe_util.py
index ed6fe1801..32e284d54 100644
--- a/testing/scripts/rust/exe_util.py
+++ b/testing/scripts/rust/exe_util.py
@@ -5,7 +5,7 @@
"""
import os
-import pty
+import subprocess
import re
# Regex for matching 7-bit and 8-bit C1 ANSI sequences.
@@ -37,15 +37,7 @@ def run_and_tee_output(args):
Returns:
The full executable output as an UTF-8 string.
"""
- output_bytes = bytearray()
-
- def read(fd):
- data = os.read(fd, 1024)
- output_bytes.extend(data)
- return data
-
- pty.spawn(args, read)
-
+ output_bytes = subprocess.check_output(args)
# Strip ANSI / terminal escapes.
output_bytes = _ANSI_ESCAPE_8BIT_REGEX.sub(b'', output_bytes)