[Python-checkins] gh-96143: subprocess API %s/universal_newlines=/text=/g. (GH-96468)

miss-islington webhook-mailer at python.org
Thu Sep 1 05:48:13 EDT 2022


https://github.com/python/cpython/commit/e93d1bda77b71db7ca150187f841fbb237772b2c
commit: e93d1bda77b71db7ca150187f841fbb237772b2c
branch: main
author: Gregory P. Smith <greg at krypto.org>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022年09月01日T02:47:40-07:00
summary:
gh-96143: subprocess API %s/universal_newlines=/text=/g. (GH-96468)
minor missed test cleanup to use the modern API from the big review.
Automerge-Triggered-By: GH:gpshead
files:
M Lib/test/test_perf_profiler.py
diff --git a/Lib/test/test_perf_profiler.py b/Lib/test/test_perf_profiler.py
index f587995b008f..2b977d78d393 100644
--- a/Lib/test/test_perf_profiler.py
+++ b/Lib/test/test_perf_profiler.py
@@ -108,7 +108,7 @@ def baz():
 script = make_script(script_dir, "perftest", code)
 with subprocess.Popen(
 [sys.executable, "-Xperf", script],
- universal_newlines=True,
+ text=True,
 stderr=subprocess.PIPE,
 stdout=subprocess.PIPE,
 ) as process:
@@ -157,7 +157,7 @@ def baz():
 script = make_script(script_dir, "perftest", code)
 with subprocess.Popen(
 [sys.executable, script],
- universal_newlines=True,
+ text=True,
 stderr=subprocess.PIPE,
 stdout=subprocess.PIPE,
 ) as process:
@@ -211,7 +211,7 @@ def is_unwinding_reliable():
 def perf_command_works():
 try:
 cmd = ["perf", "--help"]
- stdout = subprocess.check_output(cmd, universal_newlines=True)
+ stdout = subprocess.check_output(cmd, text=True)
 except (subprocess.SubprocessError, OSError):
 return False
 
@@ -237,7 +237,7 @@ def perf_command_works():
 'print("hello")',
 )
 stdout = subprocess.check_output(
- cmd, cwd=script_dir, universal_newlines=True, stderr=subprocess.STDOUT
+ cmd, cwd=script_dir, text=True, stderr=subprocess.STDOUT
 )
 except (subprocess.SubprocessError, OSError):
 return False


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /