Chromium Code Reviews| Index: recipe_engine/autoroll.py |
| diff --git a/recipe_engine/autoroll.py b/recipe_engine/autoroll.py |
| index bb65b11207d85aca2f4fd563d2a89cc0d4d47101..e1143ae1548bafdd4cd18f29042ec124a4f043d7 100644 |
| --- a/recipe_engine/autoroll.py |
| +++ b/recipe_engine/autoroll.py |
| @@ -4,6 +4,7 @@ |
| from __future__ import print_function |
| +import argparse |
| import copy |
| import json |
| import logging |
| @@ -273,7 +274,7 @@ def add_subparser(parser): |
| 'autoroll', help=helpstr, description=helpstr) |
| autoroll_p.add_argument( |
| '--output-json', |
| - type=os.path.abspath, |
| + type=argparse.FileType('w'), |
|
dnj
2017/04/27 17:19:03
I think we should explicitly close this when we're
iannucci
2017/04/29 18:30:56
Done.
|
| help='A json file to output information about the roll to.') |
| autoroll_p.add_argument( |
| '--verbose-json', |
| @@ -318,7 +319,6 @@ def main(_package_deps, args): |
| run_simulation_test(repo_root, package_spec.recipes_path, ['train']) |
| if args.output_json: |
| - with open(args.output_json, 'w') as f: |
| - json.dump(results, f, sort_keys=True, indent=2) |
| + json.dump(results, args.output_json, sort_keys=True, indent=2) |
| return 0 |