Bug 1621960: Improves genpgocert compatibility with Python 3 r=rstewart

Depends on D77965

Differential Revision: https://phabricator.services.mozilla.com/D77966
This commit is contained in:
Mitchell Hentges 2020-06-09 16:44:40 +00:00
Родитель fc50a9dcd8
Коммит 1c169fac1c
1 изменённых файлов: 3 добавлений и 2 удалений

Просмотреть файл

@ -55,7 +55,8 @@ def runUtil(util, args, inputdata=None, outputstream=None):
env[pathvar] = app_path env[pathvar] = app_path
proc = subprocess.Popen([util] + args, env=env, proc = subprocess.Popen([util] + args, env=env,
stdin=subprocess.PIPE if inputdata else None, stdin=subprocess.PIPE if inputdata else None,
stdout=outputstream) stdout=outputstream,
universal_newlines=True)
proc.communicate(inputdata) proc.communicate(inputdata)
return proc.returncode return proc.returncode
@ -101,7 +102,7 @@ def constructCertDatabase(build, srcDir):
pykey = os.path.join(build.topsrcdir, "security", "manager", "ssl", "tests", pykey = os.path.join(build.topsrcdir, "security", "manager", "ssl", "tests",
"unit", "pykey.py") "unit", "pykey.py")
with NamedTemporaryFile() as pwfile, TemporaryDirectory() as pemfolder: with NamedTemporaryFile(mode="wt+") as pwfile, TemporaryDirectory() as pemfolder:
pwfile.write("\n") pwfile.write("\n")
pwfile.flush() pwfile.flush()