summaryrefslogtreecommitdiff
path: root/pysnmp/carrier/asyncore/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'pysnmp/carrier/asyncore/base.py')
-rw-r--r--pysnmp/carrier/asyncore/base.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pysnmp/carrier/asyncore/base.py b/pysnmp/carrier/asyncore/base.py
index 144e9769..36e1008a 100644
--- a/pysnmp/carrier/asyncore/base.py
+++ b/pysnmp/carrier/asyncore/base.py
@@ -12,6 +12,14 @@ class AbstractSocketTransport(asyncore.dispatcher):
retryCount = 0; retryInterval = 0
def __init__(self, sock=None, sockMap=None):
if sock is None:
+ if self.sockFamily is None:
+ raise error.CarrierError(
+ 'Address family %s not supported' % self.__class__.__name__
+ )
+ if self.sockType is None:
+ raise error.CarrierError(
+ 'Socket type %s not supported' % self.__class__.__name__
+ )
try:
sock = socket.socket(self.sockFamily, self.sockType)
except socket.error, why: