Skip to content

Commit

Permalink
pythongh-96143: subprocess API %s/universal_newlines=/text=/g. (pytho…
Browse files Browse the repository at this point in the history
…nGH-96468)

minor missed test cleanup to use the modern API from the big review.

Automerge-Triggered-By: GH:gpshead
  • Loading branch information
gpshead authored Sep 1, 2022
1 parent 0cd33e1 commit e93d1bd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit e93d1bd

Please sign in to comment.