[opt-viewer] Python 3 support in opt-diff.py

Summary:
The `file()` builtin is not available in Python 3; use `open()` instead.
https://docs.python.org/3.0/whatsnew/3.0.html#builtins

Reviewers: anemet, davidxl, davide

Reviewed By: davide

Subscribers: davide, fhahn, llvm-commits

Differential Revision: https://reviews.llvm.org/D34670

llvm-svn: 306423
This commit is contained in:
Brian Gesiak 2017-06-27 16:46:50 +00:00
parent 22322fb638
commit 9473db43b6
1 changed files with 2 additions and 2 deletions

View File

@ -66,5 +66,5 @@ if __name__ == '__main__':
r.Added = True
for r in removed:
r.Added = False
stream = file(args.output, 'w')
yaml.dump_all(added | removed, stream)
with open(args.output, 'w') as stream:
yaml.dump_all(added | removed, stream)