aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'googlemock/scripts')
-rw-r--r--googlemock/scripts/README.md2
-rwxr-xr-xgooglemock/scripts/pump.py13
2 files changed, 8 insertions, 7 deletions
diff --git a/googlemock/scripts/README.md b/googlemock/scripts/README.md
index fa359fed..a3301e5b 100644
--- a/googlemock/scripts/README.md
+++ b/googlemock/scripts/README.md
@@ -1,5 +1,5 @@
# Please Note:
Files in this directory are no longer supported by the maintainers. They
-represent mosty historical artifacts and supported by the community only. There
+represent mostly historical artifacts and supported by the community only. There
is no guarantee whatsoever that these scripts still work.
diff --git a/googlemock/scripts/pump.py b/googlemock/scripts/pump.py
index 66e32170..5523a19d 100755
--- a/googlemock/scripts/pump.py
+++ b/googlemock/scripts/pump.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python2.7
+#!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
@@ -64,6 +64,7 @@ GRAMMAR:
from __future__ import print_function
+import io
import os
import re
import sys
@@ -834,7 +835,7 @@ def main(argv):
sys.exit(1)
file_path = argv[-1]
- output_str = ConvertFromPumpSource(file(file_path, 'r').read())
+ output_str = ConvertFromPumpSource(io.open(file_path, 'r').read())
if file_path.endswith('.pump'):
output_file_path = file_path[:-5]
else:
@@ -842,11 +843,11 @@ def main(argv):
if output_file_path == '-':
print(output_str,)
else:
- output_file = file(output_file_path, 'w')
- output_file.write('// This file was GENERATED by command:\n')
- output_file.write('// %s %s\n' %
+ 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' %
(os.path.basename(__file__), os.path.basename(file_path)))
- output_file.write('// DO NOT EDIT BY HAND!!!\n\n')
+ output_file.write(u'// DO NOT EDIT BY HAND!!!\n\n')
output_file.write(output_str)
output_file.close()