Checks if the family is valid for the current environment.
(family)
| 85 | raise ValueError('unrecognized family') |
| 86 | |
| 87 | def _validate_family(family): |
| 88 | ''' |
| 89 | Checks if the family is valid for the current environment. |
| 90 | ''' |
| 91 | if sys.platform != 'win32' and family == 'AF_PIPE': |
| 92 | raise ValueError('Family %s is not recognized.' % family) |
| 93 | |
| 94 | if sys.platform == 'win32' and family == 'AF_UNIX': |
| 95 | # double check |
| 96 | if not hasattr(socket, family): |
| 97 | raise ValueError('Family %s is not recognized.' % family) |
| 98 | |
| 99 | def address_type(address): |
| 100 | ''' |