Skip to content

Commit c852808

Browse files
committed
Review comments. Round 6.
1 parent d101465 commit c852808

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

utils/symbolicate-linux-fatal

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ from __future__ import print_function
2626

2727
import argparse
2828
import subprocess
29-
import sys
3029

3130
import lldb
3231

@@ -127,14 +126,11 @@ def main():
127126
parser.add_argument(
128127
"binary", help="Executable which produced the log file")
129128
parser.add_argument(
130-
"log", help="Log file containing the stack trace to symbolicate")
129+
"log", type=argparse.FileType("rU"),
130+
help="Log file containing the stack trace to symbolicate")
131131
args = parser.parse_args()
132132

133133
binary = args.binary
134-
if args.log == "-":
135-
logfile = sys.stdin
136-
else:
137-
logfile = open(args.log, 'rU')
138134

139135
lddoutput = subprocess.check_output(
140136
['ldd', binary], stderr=subprocess.STDOUT)
@@ -143,7 +139,7 @@ def main():
143139
instack = False
144140
stackidx = 0
145141
stack = []
146-
for line in logfile:
142+
for line in args.log:
147143
if instack and line.startswith(str(stackidx)):
148144
stack.append(line)
149145
stackidx = stackidx + 1

0 commit comments

Comments
 (0)