diff --git a/python/google/protobuf/internal/well_known_types.py b/python/google/protobuf/internal/well_known_types.py index 4e7c79a91b..0d95b4b982 100644 --- a/python/google/protobuf/internal/well_known_types.py +++ b/python/google/protobuf/internal/well_known_types.py @@ -68,7 +68,7 @@ class Any(object): def TypeName(self): """Returns the protobuf type name of the inner message.""" # Only last part is to be used: b/25630112 - return self.type_url.split('/')[-1] + return self.type_url.rpartition('/')[2] def Is(self, descriptor): """Checks if this Any represents the given protobuf type."""