(self)
| 174 | |
| 175 | @property |
| 176 | def port(self): |
| 177 | port = self._hostinfo[1] |
| 178 | if port is not None: |
| 179 | if port.isdigit() and port.isascii(): |
| 180 | port = int(port) |
| 181 | else: |
| 182 | raise ValueError(f"Port could not be cast to integer value as {port!r}") |
| 183 | if not (0 <= port <= 65535): |
| 184 | raise ValueError("Port out of range 0-65535") |
| 185 | return port |
| 186 | |
| 187 | __class_getitem__ = classmethod(types.GenericAlias) |
| 188 |
no test coverage detected