File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -668,7 +668,7 @@ def _get_field_default_gen(cls, field: dataclasses.Field) -> Any:
668
668
elif t .__origin__ in (list , List ):
669
669
# This is some kind of list (repeated) field.
670
670
return list
671
- elif t .__origin__ == Union and t .__args__ [1 ] == type (None ):
671
+ elif t .__origin__ is Union and t .__args__ [1 ] is type (None ):
672
672
# This is an optional (wrapped) field. For setting the default we
673
673
# really don't care what kind of field it is.
674
674
return type (None )
@@ -748,10 +748,10 @@ def parse(self: T, data: bytes) -> T:
748
748
pos = 0
749
749
value = []
750
750
while pos < len (parsed .value ):
751
- if meta .proto_type in ["float" , "fixed32" , "sfixed32" ]:
751
+ if meta .proto_type in [TYPE_FLOAT , TYPE_FIXED32 , TYPE_SFIXED32 ]:
752
752
decoded , pos = parsed .value [pos : pos + 4 ], pos + 4
753
753
wire_type = WIRE_FIXED_32
754
- elif meta .proto_type in ["double" , "fixed64" , "sfixed64" ]:
754
+ elif meta .proto_type in [TYPE_DOUBLE , TYPE_FIXED64 , TYPE_SFIXED64 ]:
755
755
decoded , pos = parsed .value [pos : pos + 8 ], pos + 8
756
756
wire_type = WIRE_FIXED_64
757
757
else :
You can’t perform that action at this time.
0 commit comments