Skip to content
Permalink
Browse files

Python 3: Fix use of subprocess (#9716)

* Python 3: Fix use of subprocess

* Revert unnecessary change
  • Loading branch information...
leonardder authored and michaelDCurran committed Jun 11, 2019
1 parent 840dce5 commit 031532db1b3652d0b169f81b7aafadd87b06f51d
Showing with 9 additions and 9 deletions.
  1. +2 −2 appveyor/mozillaSyms.py
  2. +1 −1 appx/sconscript
  3. +2 −2 source/core.py
  4. +1 −1 source/gui/installerGui.py
  5. +2 −2 source/nvda_slave.pyw
  6. +1 −1 source/updateCheck.py
@@ -6,7 +6,6 @@
To update the list of symbols uploaded to Mozilla, see the DLL_NAMES constant below.
"""

from __future__ import print_function
import argparse
import os
import subprocess
@@ -43,7 +42,8 @@ def __init__(self, returncode, stderr):
def check_output(command):
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stderr=subprocess.PIPE,
text=True)
stdout, stderr = proc.communicate()
if proc.returncode != 0:
raise ProcError(proc.returncode, stderr)
@@ -31,7 +31,7 @@ def getCertPublisher(env):
return env['publisher']
certPassword=env.get('certPassword','')
cmd=['certutil','-dump','-p',certPassword,File('#'+certFile).abspath.replace('/','\\')]
lines=subprocess.check_output(cmd).splitlines()
lines=subprocess.run(cmd,check=True,capture_output=True,text=True).stdout.splitlines()
linePrefix='Subject: '
for line in lines:
if line.startswith(linePrefix):
@@ -125,8 +125,8 @@ def restart(disableAddons=False, debugLogging=False):
except ValueError:
pass
shellapi.ShellExecute(None, None,
sys.executable.decode("mbcs"),
subprocess.list2cmdline(sys.argv + options).decode("mbcs"),
sys.executable,
subprocess.list2cmdline(sys.argv + options),
None,
# #4475: ensure that the first window of the new process is not hidden by providing SW_SHOWNORMAL
winUser.SW_SHOWNORMAL)
@@ -380,6 +380,6 @@ def doCreatePortable(portableDirectory,copyUserConfig=False,silent=False,startAf
if startAfterCreate:
# #4475: ensure that the first window of the new process is not hidden by providing SW_SHOWNORMAL
shellapi.ShellExecute(None, None,
os.path.join(os.path.abspath(unicode(portableDirectory)),'nvda.exe'),
os.path.join(os.path.abspath(portableDirectory),'nvda.exe'),
u"-r",
None, winUser.SW_SHOWNORMAL)
@@ -48,8 +48,8 @@ def main():
import shellapi
import winUser
shellapi.ShellExecute(0,None,
ur"%s\nvda.exe"%sys.exec_prefix.decode("mbcs"),
subprocess.list2cmdline(args).decode("mbcs"),
r"%s\nvda.exe"%sys.exec_prefix,
subprocess.list2cmdline(args),
None,winUser.SW_SHOWNORMAL)
elif action=="setNvdaSystemConfig":
import config
@@ -206,7 +206,7 @@ def _executeUpdate(destPath):
executeParams = u"--launcher"
# #4475: ensure that the new process shows its first window, by providing SW_SHOWNORMAL
shellapi.ShellExecute(None, None,
destPath.decode("mbcs"),
destPath,
executeParams,
None, winUser.SW_SHOWNORMAL)

0 comments on commit 031532d

Please sign in to comment.
You can’t perform that action at this time.