aboutsummaryrefslogtreecommitdiff
path: root/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py')
-rwxr-xr-xpython/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py b/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py
index 53e9d507..e71b295b 100755
--- a/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py
+++ b/python/compatibility_tests/v2.5.0/tests/google/protobuf/internal/message_test.py
@@ -55,6 +55,11 @@ from google.protobuf.internal import api_implementation
from google.protobuf.internal import test_util
from google.protobuf import message
+try:
+ cmp # Python 2
+except NameError:
+ cmp = lambda x, y: (x > y) - (x < y) # Python 3
+
# Python pre-2.6 does not have isinf() or isnan() functions, so we have
# to provide our own.
def isnan(val):