Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
e08a4602
Commit
e08a4602
authored
Nov 05, 2019
by
Xiaoyi Zhang
Browse files
Merge pull request #2549 from kuzkry:pump-support-for-python-3
PiperOrigin-RevId: 278702666
parents
8aedd597
442f45b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
googlemock/scripts/pump.py
googlemock/scripts/pump.py
+7
-6
No files found.
googlemock/scripts/pump.py
View file @
e08a4602
#!/usr/bin/env python
2.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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment