Skip to content

Commit aeb0006

Browse files
committed
Replace python subprocess's universal_newlines with text. NFC
In python 3.7 the `universal_newlines` parameter was deprecated in favor of the more readable `text` parameter. We updated our minimum supported python version to 3.8 in #23417.
1 parent 242af00 commit aeb0006

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

test/jsrun.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def run_js(filename, engine, args=None,
106106
stderr=stderr,
107107
cwd=cwd,
108108
timeout=timeout,
109-
universal_newlines=True)
109+
text=True)
110110
except Exception:
111111
# the failure may be because the engine is not present. show the proper
112112
# error in that case

tools/maint/check_for_closed_issues.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717

1818
def run(*args, **kwargs):
19-
kwargs['universal_newlines'] = True
19+
kwargs['text'] = True
2020
return subprocess.check_output(*args, **kwargs)
2121

2222

tools/shared.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def run_process(cmd, check=True, input=None, *args, **kw):
126126
# output before messages that we have already written.
127127
sys.stdout.flush()
128128
sys.stderr.flush()
129-
kw.setdefault('universal_newlines', True)
129+
kw.setdefault('text', True)
130130
kw.setdefault('encoding', 'utf-8')
131131
ret = subprocess.run(cmd, check=check, input=input, *args, **kw)
132132
debug_text = '%sexecuted %s' % ('successfully ' if check else '', shlex_join(cmd))

0 commit comments

Comments
 (0)