summaryrefslogtreecommitdiff
path: root/pysnmp/carrier
diff options
context:
space:
mode:
authorelie <elie>2015-10-16 17:11:30 +0000
committerelie <elie>2015-10-16 17:11:30 +0000
commit029559a5da3cbbe666e3a771f13280cad578b142 (patch)
treeaea833229bc4cd593fe382751f39fb21a5298b25 /pysnmp/carrier
parent42f58d393cb4d23522890ea330484a03db53ef2e (diff)
downloadpysnmp-git-029559a5da3cbbe666e3a771f13280cad578b142.tar.gz
explicitly check for proper Python version
Diffstat (limited to 'pysnmp/carrier')
-rw-r--r--pysnmp/carrier/sockmsg.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/pysnmp/carrier/sockmsg.py b/pysnmp/carrier/sockmsg.py
index d0666eb7..e83374f5 100644
--- a/pysnmp/carrier/sockmsg.py
+++ b/pysnmp/carrier/sockmsg.py
@@ -10,17 +10,16 @@
# Parts of the code below is taken from:
# http://carnivore.it/2012/10/12/python3.3_sendmsg_and_recvmsg
#
-try:
- import ctypes
- import ipaddress
-except ImportError:
+import sys
+if sys.version_info[:2] < (3, 3):
def getRecvFrom(addressType):
raise error.CarrierError('sendmsg()/recvmsg() interface is not supported by this OS and/or Python version')
def getSendTo(addressType):
raise error.CarrierError('sendmsg()/recvmsg() interface is not supported by this OS and/or Python version')
else:
- import sys
+ import ctypes
+ import ipaddress
import socket
from pysnmp import debug
from pysnmp.carrier import sockfix, error