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
a4f634ce
Commit
a4f634ce
authored
Feb 06, 2015
by
zex
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix raise syntax issues for py3,
fix except syntax issue for py3
parent
20490e33
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 @
a4f634ce
...
...
@@ -314,7 +314,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
):
...
...
@@ -863,7 +863,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