Skip to content

Commit

Permalink
[cr92 followup] Fixes signing on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarolin committed Jun 30, 2021
1 parent 0b9ef3d commit 0531029
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions script/sign_binaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def get_sign_cmd(file):


def run_cmd(cmd):
with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p:
for line in p.stdout:
print(line)
p.wait()
assert p.returncode == 0, "Error signing"
p = subprocess.Popen(cmd, stdout=subprocess.PIPE) # pylint: disable=consider-using-with
for line in p.stdout:
print(line)
p.wait()
assert p.returncode == 0, "Error signing"


def sign_binaries(base_dir, endswidth=('.exe', '.dll')):
Expand Down
13 changes: 7 additions & 6 deletions tools/win/generate_breakpad_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def GetCommandOutput(command):
From chromium_utils.
"""
with open(os.devnull, 'w') as devnull:
with subprocess.Popen(command, stdout=subprocess.PIPE, stderr=devnull, bufsize=1) as proc:
output = proc.communicate()[0]
return output.decode('utf-8')
devnull = open(os.devnull, 'w') # pylint: disable=consider-using-with
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=devnull) # pylint: disable=consider-using-with
output = proc.communicate()[0]
return output.decode('utf-8')


def mkdir_p(path):
Expand Down Expand Up @@ -76,8 +76,9 @@ def _Worker():
module_line.group(1))
mkdir_p(output_path)
symbol_file = "%s.sym" % module_line.group(2)[:-4] # strip .pdb
with open(os.path.join(output_path, symbol_file), 'w') as f:
f.write(syms)
f = open(os.path.join(output_path, symbol_file), 'w') # pylint: disable=consider-using-with
f.write(syms)
f.close()

if options.verbose:
with print_lock:
Expand Down

0 comments on commit 0531029

Please sign in to comment.