Fix exceptions if python is built without ipv6 support.

See:
http://bugs.python.org/issue16208
http://bugs.python.org/issue7735
Can you please add a comment above the line describing that with IPv6 disabled the value type is int.