File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -944,9 +944,9 @@ def _postprocess_single(
944
944
elif meta .proto_type == TYPE_MESSAGE :
945
945
cls = self ._betterproto .cls_by_field [field_name ]
946
946
947
- if cls == datetime :
947
+ if cls is datetime :
948
948
value = _Timestamp ().parse (value ).to_datetime ()
949
- elif cls == timedelta :
949
+ elif cls is timedelta :
950
950
value = _Duration ().parse (value ).to_timedelta ()
951
951
elif meta .wraps :
952
952
# This is a Google wrapper value message around a single
@@ -1105,9 +1105,9 @@ def to_dict(
1105
1105
elif field_is_repeated :
1106
1106
# Convert each item.
1107
1107
cls = self ._betterproto .cls_by_field [field_name ]
1108
- if cls == datetime :
1108
+ if cls is datetime :
1109
1109
value = [_Timestamp .timestamp_to_json (i ) for i in value ]
1110
- elif cls == timedelta :
1110
+ elif cls is timedelta :
1111
1111
value = [_Duration .delta_to_json (i ) for i in value ]
1112
1112
else :
1113
1113
value = [
You can’t perform that action at this time.
0 commit comments