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