Set file mode in the argparse argument
Bug: webrtc:13607 Change-Id: I7943761933e0e110ff16b65284d8b36644b5c4ea Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/251381 Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Commit-Queue: Christoffer Jansson <jansson@google.com> Cr-Commit-Position: refs/heads/main@{#35970}
This commit is contained in:
parent
1a41178e33
commit
e6aa6a8740
@ -195,7 +195,7 @@ def _ApplyHacks(dicts):
|
||||
|
||||
def _LoadHistogramSetFromProto(options):
|
||||
hs = histogram_set.HistogramSet()
|
||||
with open(options.input_results_file, 'rb') as f:
|
||||
with options.input_results_file as f:
|
||||
hs.ImportProto(f.read())
|
||||
|
||||
return hs
|
||||
|
||||
@ -58,7 +58,7 @@ def _CreateParser():
|
||||
required=True,
|
||||
help='Which dashboard to use.')
|
||||
parser.add_argument('--input-results-file',
|
||||
type=argparse.FileType(),
|
||||
type=argparse.FileType('rb'),
|
||||
required=True,
|
||||
help='A HistogramSet proto file with output from '
|
||||
'WebRTC tests.')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user