Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
442f45b3
Commit
442f45b3
authored
Nov 02, 2019
by
Krystian Kuzniarek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pump.py: add support for Python 3
parent
e8a82dc7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
pump.py
googlemock/scripts/pump.py
+7
-6
No files found.
googlemock/scripts/pump.py
View file @
442f45b3
#!/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