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

Unified Diff: third_party/protobuf/python/google/protobuf/internal/wire_format_test.py

Issue 1842653006: Update //third_party/protobuf to version 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 4 years, 8 months 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/python/google/protobuf/internal/wire_format_test.py
diff --git a/third_party/protobuf/python/google/protobuf/internal/wire_format_test.py b/third_party/protobuf/python/google/protobuf/internal/wire_format_test.py
index 760077860349b56ea57f27507492fc88e42bba87..f659d18e42d9279b0f7e613c455c1ad1ff6c8657 100755
--- a/third_party/protobuf/python/google/protobuf/internal/wire_format_test.py
+++ b/third_party/protobuf/python/google/protobuf/internal/wire_format_test.py
@@ -1,8 +1,8 @@
-#! /usr/bin/python
+#! /usr/bin/env python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
-# http://code.google.com/p/protobuf/
+# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
@@ -34,7 +34,10 @@
__author__ = 'robinson@google.com (Will Robinson)'
-import unittest
+try:
+ import unittest2 as unittest
+except ImportError:
+ import unittest
from google.protobuf import message
from google.protobuf.internal import wire_format
@@ -195,7 +198,7 @@ class WireFormatTest(unittest.TestCase):
# Test UTF-8 string byte size calculation.
# 1 byte for tag, 1 byte for length, 8 bytes for content.
self.assertEqual(10, wire_format.StringByteSize(
- 5, unicode('\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82', 'utf-8')))
+ 5, b'\xd0\xa2\xd0\xb5\xd1\x81\xd1\x82'.decode('utf-8')))
class MockMessage(object):
def __init__(self, byte_size):

Powered by Google App Engine
This is Rietveld 408576698