File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 1
- #!/usr/bin/env python2.7
1
+ #!/usr/bin/env python
2
2
#
3
3
# Copyright 2008, Google Inc.
4
4
# All rights reserved.
64
64
65
65
from __future__ import print_function
66
66
67
+ import io
67
68
import os
68
69
import re
69
70
import sys
@@ -834,19 +835,19 @@ def main(argv):
834
835
sys .exit (1 )
835
836
836
837
file_path = argv [- 1 ]
837
- output_str = ConvertFromPumpSource (file (file_path , 'r' ).read ())
838
+ output_str = ConvertFromPumpSource (io . open (file_path , 'r' ).read ())
838
839
if file_path .endswith ('.pump' ):
839
840
output_file_path = file_path [:- 5 ]
840
841
else :
841
842
output_file_path = '-'
842
843
if output_file_path == '-' :
843
844
print (output_str ,)
844
845
else :
845
- output_file = file (output_file_path , 'w' )
846
- output_file .write ('// This file was GENERATED by command:\n ' )
847
- output_file .write ('// %s %s\n ' %
846
+ output_file = io . open (output_file_path , 'w' )
847
+ output_file .write (u '// This file was GENERATED by command:\n ' )
848
+ output_file .write (u '// %s %s\n ' %
848
849
(os .path .basename (__file__ ), os .path .basename (file_path )))
849
- output_file .write ('// DO NOT EDIT BY HAND!!!\n \n ' )
850
+ output_file .write (u '// DO NOT EDIT BY HAND!!!\n \n ' )
850
851
output_file .write (output_str )
851
852
output_file .close ()
852
853
You can’t perform that action at this time.
0 commit comments