Fix exceptions if python is built without ipv6 support.

See:
http://bugs.python.org/issue16208
http://bugs.python.org/issue7735
What type is `host[4][0]` in your case? Are you using Python 2 or 3?