Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: third_party/protobuf/conformance/conformance_python.py

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/conformance/conformance_python.py
diff --git a/third_party/protobuf/conformance/conformance_python.py b/third_party/protobuf/conformance/conformance_python.py
index a490c8e8e54bd68e26ef4d10a5f4685dff51b2c4..2f4a7812e5e447d94325f95122497c6722601634 100755
--- a/third_party/protobuf/conformance/conformance_python.py
+++ b/third_party/protobuf/conformance/conformance_python.py
@@ -67,7 +67,7 @@ def do_test(request):
elif request.WhichOneof('payload') == 'json_payload':
try:
json_format.Parse(request.json_payload, test_message)
- except json_format.ParseError as e:
+ except Exception as e:
response.parse_error = str(e)
return response
@@ -81,7 +81,11 @@ def do_test(request):
response.protobuf_payload = test_message.SerializeToString()
elif request.requested_output_format == conformance_pb2.JSON:
- response.json_payload = json_format.MessageToJson(test_message)
+ try:
+ response.json_payload = json_format.MessageToJson(test_message)
+ except Exception as e:
+ response.serialize_error = str(e)
+ return response
except Exception as e:
response.runtime_error = str(e)

Powered by Google App Engine
This is Rietveld 408576698