summaryrefslogtreecommitdiff
path: root/pysnmp/hlapi/v1arch/asyncore
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/hlapi/v1arch/asyncore')
-rw-r--r--pysnmp/hlapi/v1arch/asyncore/transport.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/pysnmp/hlapi/v1arch/asyncore/transport.py b/pysnmp/hlapi/v1arch/asyncore/transport.py
index f0bd17e8..78630e27 100644
--- a/pysnmp/hlapi/v1arch/asyncore/transport.py
+++ b/pysnmp/hlapi/v1arch/asyncore/transport.py
@@ -53,9 +53,9 @@ class UdpTransportTarget(AbstractTransportTarget):
socket.AF_INET,
socket.SOCK_DGRAM,
socket.IPPROTO_UDP)[0][4][:2]
- except socket.gaierror:
+ except socket.gaierror as exc:
raise error.PySnmpError('Bad IPv4/UDP transport address %s: %s' % (
- '@'.join([str(x) for x in transportAddr]), sys.exc_info()[1]))
+ '@'.join([str(x) for x in transportAddr]), exc))
class Udp6TransportTarget(AbstractTransportTarget):
@@ -106,6 +106,6 @@ class Udp6TransportTarget(AbstractTransportTarget):
socket.AF_INET6,
socket.SOCK_DGRAM,
socket.IPPROTO_UDP)[0][4][:2]
- except socket.gaierror:
+ except socket.gaierror as exc:
raise error.PySnmpError('Bad IPv6/UDP transport address %s: %s' % (
- '@'.join([str(x) for x in transportAddr]), sys.exc_info()[1]))
+ '@'.join([str(x) for x in transportAddr]), exc))