diff options
author | Abseil Team <absl-team@google.com> | 2019-11-01 10:28:59 (GMT) |
---|---|---|
committer | Gennadiy Civil <misterg@google.com> | 2019-11-18 15:39:32 (GMT) |
commit | 0f0634a66e95ae64d769171a0a96b87e60dfa207 (patch) | |
tree | b334848bedc3d4a3d55a62f3a93009b9fe73c809 /googlemock/scripts/pump.py | |
parent | c27acebba3b3c7d94209e0467b0a801db4af73ed (diff) | |
download | googletest-0f0634a66e95ae64d769171a0a96b87e60dfa207.zip googletest-0f0634a66e95ae64d769171a0a96b87e60dfa207.tar.gz googletest-0f0634a66e95ae64d769171a0a96b87e60dfa207.tar.bz2 |
Googletest exportrefs/pull/2576/head4422C11159FF3F7F49E4BC959EE89D06
- 277898422 BEGIN_PUBLIC by Abseil Team <absl-team@google.com>
PiperOrigin-RevId: 277898422
Diffstat (limited to 'googlemock/scripts/pump.py')
-rwxr-xr-x | googlemock/scripts/pump.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/googlemock/scripts/pump.py b/googlemock/scripts/pump.py index 5523a19..66e3217 100755 --- a/googlemock/scripts/pump.py +++ b/googlemock/scripts/pump.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python2.7 # # Copyright 2008, Google Inc. # All rights reserved. @@ -64,7 +64,6 @@ GRAMMAR: from __future__ import print_function -import io import os import re import sys @@ -835,7 +834,7 @@ def main(argv): sys.exit(1) file_path = argv[-1] - output_str = ConvertFromPumpSource(io.open(file_path, 'r').read()) + output_str = ConvertFromPumpSource(file(file_path, 'r').read()) if file_path.endswith('.pump'): output_file_path = file_path[:-5] else: @@ -843,11 +842,11 @@ def main(argv): if output_file_path == '-': print(output_str,) else: - output_file = io.open(output_file_path, 'w') - output_file.write(u'// This file was GENERATED by command:\n') - output_file.write(u'// %s %s\n' % + output_file = file(output_file_path, 'w') + output_file.write('// This file was GENERATED by command:\n') + output_file.write('// %s %s\n' % (os.path.basename(__file__), os.path.basename(file_path))) - output_file.write(u'// DO NOT EDIT BY HAND!!!\n\n') + output_file.write('// DO NOT EDIT BY HAND!!!\n\n') output_file.write(output_str) output_file.close() |