Creates an AttrValue for a python object.
(attr_name, value)
| 1188 | |
| 1189 | |
| 1190 | def _get_kwarg_as_str_attr(attr_name, value): |
| 1191 | """Creates an AttrValue for a python object.""" |
| 1192 | if isinstance(value, str): |
| 1193 | return attr_value_pb2.AttrValue(s=compat.as_bytes(value)) |
| 1194 | else: |
| 1195 | raise ValueError("Unsupported attribute type for %s with type %s" % |
| 1196 | (attr_name, type(value))) |
| 1197 | |
| 1198 | |
| 1199 | def _parse_kwargs_as_attrs(func_name, **kwargs): |
no test coverage detected