Changeset: f9b94247ae68 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f9b94247ae68
Modified Files:
testing/Mtest.py.in
testing/process.py
Branch: Jun2020
Log Message:
Modernize: use text instead of universal_newlines.
diffs (truncated from 367 to 300 lines):
diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -1475,7 +1475,7 @@ def ApproveOutput (env, TST) :
f = openutf8(patch + '.0', 'w')
proc = process.Popen(['diff', '-Bb', '-I^[#=]', '-I^MAPI *=',
'-U0',
stableOUTPUT, testOUTPUT],
- stdout = f, universal_newlines = True)
+ stdout=f, text=True)
proc.wait()
f.close()
if os.path.getsize(patch + ".0"):
@@ -1519,12 +1519,12 @@ def ApproveOutput (env, TST) :
if not verbose:
patchcmd.append('--quiet')
proc = process.Popen(patchcmd + [stableOUTPUT, patch + '.1'],
- universal_newlines = True)
+ text=True)
proc.wait()
f = openutf8(patch, 'w')
proc = process.Popen(['diff', '-u', stableOUTPUT + '.ORG',
stableOUTPUT],
- stdout = f, universal_newlines = True)
+ stdout=f, text=True)
proc.wait()
f.close()
remove(stableOUTPUT + ".ORG")
@@ -1544,7 +1544,7 @@ def ApproveOutput (env, TST) :
elif f != thefile and test.match(f):
remove(os.path.join(dir or os.curdir, f + '.rej'))
remove(os.path.join(dir or os.curdir, f + '.orig'))
-proc = process.Popen(patchcmd + ['--forward',
os.path.join(dir or os.curdir, f)], stdin = openutf8(patch), universal_newlines
= True)
+proc = process.Popen(patchcmd + ['--forward',
os.path.join(dir or os.curdir, f)], stdin=openutf8(patch), text=True)
proc.wait()
if os.path.exists(os.path.join(dir or os.curdir, f
+ '.rej')):
list.append(f)
@@ -1638,9 +1638,9 @@ def returnCode(proc, f = None):
if procdebug:
print('Starting: coredumpctl -q info %d' % proc.pid)
p = process.Popen(['coredumpctl', '-q' ,'info',
str(proc.pid)],
- stdout = process.PIPE,
- stderr = process.PIPE,
- universal_newlines = True)
+ stdout=process.PIPE,
+ stderr=process.PIPE,
+ text=True)
out, err = p.communicate()
if not err and out:
f.write(out)
@@ -1660,9 +1660,9 @@ def returnCode(proc, f = None):
if procdebug:
print('Starting: coredumpctl -q info %d' % proc.pid)
p = process.Popen(['coredumpctl', '-q' ,'info',
str(proc.pid)],
- stdout = process.PIPE,
- stderr = process.PIPE,
- universal_newlines = True)
+ stdout=process.PIPE,
+ stderr=process.PIPE,
+ text=True)
out, err = p.communicate()
if not err and out:
f.write(out)
@@ -1700,8 +1700,8 @@ def GetBitsAndModsAndThreads(env) :
if procdebug:
print('GetBitsAndModsAndThreads: starting process "%s" (inpipe,
outpipe, errpipe)\n' % '" "'.join(cmd))
setpgrp = True
-proc = process.Popen(cmd, stdin = process.PIPE, stdout = process.PIPE,
- stderr = process.PIPE, universal_newlines = True)
+proc = process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
+ stderr=process.PIPE, text=True)
proc.killed = False
proc.onechild = True
t = Timer(float(par['TIMEOUT']), killProc, args = [proc, proc.stderr, cmd])
@@ -1720,7 +1720,7 @@ def GetBitsAndModsAndThreads(env) :
if procdebug:
print('GetBitsAndModsAndThreads: starting process "%s"
(inpipe, outpipe, errpipe)\n' % '" "'.join(cmd))
clnt = process.Popen(cmd, stdin=process.PIPE, stdout=process.PIPE,
- stderr=process.PIPE, universal_newlines=True)
+ stderr=process.PIPE, text=True)
input = '''\
c :