Merge branch 'main' into avm99963-monorail

Merged commit 34d8229ae2b51fb1a15bd208e6fe6185c94f6266

GitOrigin-RevId: 7ee0917f93a577e475f8e09526dd144d245593f4
diff --git a/api/v3/paginator.py b/api/v3/paginator.py
index 16e66fa..918eb2c 100644
--- a/api/v3/paginator.py
+++ b/api/v3/paginator.py
@@ -1,14 +1,16 @@
-# Copyright 2020 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
+# Copyright 2020 The Chromium Authors
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
 
 from __future__ import print_function
 from __future__ import division
 from __future__ import absolute_import
 
+import six
+
 from framework import exceptions
 from framework import paginate
-from proto import secrets_pb2
+from mrproto import secrets_pb2
 
 
 def CoercePageSize(page_size, max_size, default_size=None):
@@ -71,7 +73,7 @@
       # string types. paginate.ValidateAndParsePageToken requires a string token
       # during validation (compare_digest()). Once we move to python 3, we can
       # remove this string casting.
-      token = str(page_token)
+      token = six.ensure_binary(page_token)
       return paginate.ValidateAndParsePageToken(token, self.request_contents)
     return 0