diff options
Diffstat (limited to 'python/google/protobuf/reflection.py')
-rwxr-xr-x | python/google/protobuf/reflection.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/python/google/protobuf/reflection.py b/python/google/protobuf/reflection.py index f345067a..5ab7a1b1 100755 --- a/python/google/protobuf/reflection.py +++ b/python/google/protobuf/reflection.py @@ -599,6 +599,10 @@ def _AddHasExtensionMethod(cls): def _AddEqualsMethod(message_descriptor, cls): """Helper for _AddMessageMethods().""" def __eq__(self, other): + if (not isinstance(other, message_mod.Message) or + other.DESCRIPTOR != self.DESCRIPTOR): + return False + if self is other: return True |