Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
42809ef8
Commit
42809ef8
authored
Mar 31, 2015
by
Joshua Haberman
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #196 from Zex/master
Fix raise and except syntax issues for py3
parents
a56d1309
a4f634ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
python_message.py
python/google/protobuf/internal/python_message.py
+2
-2
No files found.
python/google/protobuf/internal/python_message.py
View file @
42809ef8
...
...
@@ -324,7 +324,7 @@ def _ReraiseTypeErrorWithFieldName(message_name, field_name):
exc
=
TypeError
(
'
%
s for field
%
s.
%
s'
%
(
str
(
exc
),
message_name
,
field_name
))
# re-raise possibly-amended exception with original traceback:
raise
type
(
exc
)
,
exc
,
sys
.
exc_info
()[
2
]
raise
type
(
exc
)
(
exc
,
sys
.
exc_info
()[
2
])
def
_AddInitMethod
(
message_descriptor
,
cls
):
...
...
@@ -894,7 +894,7 @@ def _AddMergeFromStringMethod(message_descriptor, cls):
except
(
IndexError
,
TypeError
):
# Now ord(buf[p:p+1]) == ord('') gets TypeError.
raise
message_mod
.
DecodeError
(
'Truncated message.'
)
except
struct
.
error
,
e
:
except
struct
.
error
as
e
:
raise
message_mod
.
DecodeError
(
e
)
return
length
# Return this for legacy reasons.
cls
.
MergeFromString
=
MergeFromString
...
...
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