From 1c169fac1ca5506f96ef8322a0099213316040f3 Mon Sep 17 00:00:00 2001 From: Mitchell Hentges Date: Tue, 9 Jun 2020 16:44:40 +0000 Subject: [PATCH] Bug 1621960: Improves genpgocert compatibility with Python 3 r=rstewart Depends on D77965 Differential Revision: https://phabricator.services.mozilla.com/D77966 --- build/pgo/genpgocert.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/build/pgo/genpgocert.py b/build/pgo/genpgocert.py index 1188d5c6b591..71df41807aeb 100644 --- a/build/pgo/genpgocert.py +++ b/build/pgo/genpgocert.py @@ -55,7 +55,8 @@ def runUtil(util, args, inputdata=None, outputstream=None): env[pathvar] = app_path proc = subprocess.Popen([util] + args, env=env, stdin=subprocess.PIPE if inputdata else None, - stdout=outputstream) + stdout=outputstream, + universal_newlines=True) proc.communicate(inputdata) return proc.returncode @@ -101,7 +102,7 @@ def constructCertDatabase(build, srcDir): pykey = os.path.join(build.topsrcdir, "security", "manager", "ssl", "tests", "unit", "pykey.py") - with NamedTemporaryFile() as pwfile, TemporaryDirectory() as pemfolder: + with NamedTemporaryFile(mode="wt+") as pwfile, TemporaryDirectory() as pemfolder: pwfile.write("\n") pwfile.flush()