Fix static type checking for grpclib client (#124)

* Fix static type checking in grpclib client
* Fix python3.6 compatibility issue with dataclasses
This commit is contained in:
Arun Babu Neelicattu
2020-07-30 11:30:58 +02:00
committed by GitHub
parent 3d8c0cb713
commit beafc812ff
2 changed files with 7 additions and 6 deletions

View File

@@ -664,7 +664,8 @@ class Message(ABC):
"""Get the message class for a field from the type hints."""
field_cls = cls._type_hint(field.name)
if hasattr(field_cls, "__args__") and index >= 0:
field_cls = field_cls.__args__[index]
if field_cls.__args__ is not None:
field_cls = field_cls.__args__[index]
return field_cls
def _get_field_default(self, field_name):