diff options
author | elie <elie> | 2012-09-04 21:15:57 +0000 |
---|---|---|
committer | elie <elie> | 2012-09-04 21:15:57 +0000 |
commit | f20ae46dec53436bf79913b96be8979e0c64eff5 (patch) | |
tree | a8b576b4c005983542f5031f0ca96ed4098c0291 | |
parent | 12003152baf736001bb710acd5c0bd5d4d7b1fe0 (diff) | |
download | pysnmp-f20ae46dec53436bf79913b96be8979e0c64eff5.tar.gz |
also check socket.has_ipv6 to see if IPv6 is available
-rw-r--r-- | pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py index 518d284..c7e8a95 100644 --- a/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py +++ b/pysnmp/smi/mibs/TRANSPORT-ADDRESS-MIB.py @@ -3,13 +3,16 @@ # Python version sys.version_info(major=2, minor=7, micro=2, releaselevel='final', serial=0) try: - from socket import inet_ntop, inet_pton, AF_INET, AF_INET6 + from socket import inet_ntop, inet_pton, AF_INET, AF_INET6, has_ipv6 except ImportError: + has_ipv6 = False + +if not has_ipv6: from socket import inet_ntoa, inet_aton, AF_INET inet_ntop = lambda x,y: inet_ntoa(y) inet_pton = lambda x,y: inet_aton(y) AF_INET6 = None - + from pyasn1.compat.octets import int2oct, oct2int from pysnmp import error |