fix: build failures with older cython 0.29 series (#1232) · python-zeroconf/python-zeroconf@30c3ad9

Original file line numberDiff line numberDiff line change

@@ -25,6 +25,8 @@

2525

from .._exceptions import ServiceNameAlreadyRegistered

2626

from .info import ServiceInfo

2727
28+

_str = str

29+
2830
2931

class ServiceRegistry:

3032

"""A registry to keep track of services.

@@ -76,7 +78,7 @@ def async_get_infos_server(self, server: str) -> List[ServiceInfo]:

7678

"""Return all ServiceInfo matching server."""

7779

return self._async_get_by_index(self.servers, server)

7880
79-

def _async_get_by_index(self, records: Dict[str, List], key: str) -> List[ServiceInfo]:

81+

def _async_get_by_index(self, records: Dict[str, List], key: _str) -> List[ServiceInfo]:

8082

"""Return all ServiceInfo matching the index."""

8183

record_list = records.get(key)

8284

if record_list is None: