aboutsummaryrefslogtreecommitdiffhomepage
path: root/python/google/protobuf/descriptor.py
diff options
context:
space:
mode:
authorGravatar Dan O'Reilly <oreilldf@gmail.com>2015-08-22 13:02:24 -0400
committerGravatar Dan O'Reilly <oreilldf@gmail.com>2015-08-22 13:07:12 -0400
commit38eef02aab2cf52bce537ef43870387ba30381c8 (patch)
tree698c12a755aa8e29255444552061b028b313af72 /python/google/protobuf/descriptor.py
parentfc80874adf84b4061d6540eff32b4be05541a973 (diff)
Fix metaclass issue on Python 3. Get text handling tests passing on Python 3.
Signed-off-by: Dan O'Reilly <oreilldf@gmail.com>
Diffstat (limited to 'python/google/protobuf/descriptor.py')
-rwxr-xr-xpython/google/protobuf/descriptor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/python/google/protobuf/descriptor.py b/python/google/protobuf/descriptor.py
index 6840d1f4..95b703fc 100755
--- a/python/google/protobuf/descriptor.py
+++ b/python/google/protobuf/descriptor.py
@@ -36,6 +36,8 @@ file, in types that make this information accessible in Python.
__author__ = 'robinson@google.com (Will Robinson)'
+import six
+
from google.protobuf.internal import api_implementation
@@ -73,7 +75,7 @@ else:
DescriptorMetaclass = type
-class DescriptorBase(object):
+class DescriptorBase(six.with_metaclass(DescriptorMetaclass)):
"""Descriptors base class.
@@ -88,7 +90,6 @@ class DescriptorBase(object):
avoid some bootstrapping issues.
"""
- __metaclass__ = DescriptorMetaclass
if _USE_C_DESCRIPTORS:
# The class, or tuple of classes, that are considered as "virtual
# subclasses" of this descriptor class.