summaryrefslogtreecommitdiff
path: root/pysnmp/proto
diff options
context:
space:
mode:
authorIlya Etingof <etingof@gmail.com>2019-02-10 18:30:59 +0100
committerGitHub <noreply@github.com>2019-02-10 18:30:59 +0100
commit5c64b499c2cf6f168970aa7ae51fe4997cdd89fc (patch)
tree54a6e95198f22cf293923406f46f4eacc0f10155 /pysnmp/proto
parentcc2632d6d5c0096e0b563fb15750562c281af1eb (diff)
downloadpysnmp-git-5c64b499c2cf6f168970aa7ae51fe4997cdd89fc.tar.gz
Officially remove Python < 2.6 support (#239)
Perhaps previous commits have already broken older Python support. This commit mostly declares Python 2.6+ support.
Diffstat (limited to 'pysnmp/proto')
-rw-r--r--pysnmp/proto/rfc1902.py1
-rw-r--r--pysnmp/proto/secmod/rfc3414/priv/des.py7
2 files changed, 1 insertions, 7 deletions
diff --git a/pysnmp/proto/rfc1902.py b/pysnmp/proto/rfc1902.py
index 6c569a12..14900ce7 100644
--- a/pysnmp/proto/rfc1902.py
+++ b/pysnmp/proto/rfc1902.py
@@ -4,7 +4,6 @@
# Copyright (c) 2005-2019, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pysnmp/license.html
#
-from sys import version_info
from pyasn1.type import univ, tag, constraint, namedtype, namedval
from pysnmp.proto import rfc1155, error
diff --git a/pysnmp/proto/secmod/rfc3414/priv/des.py b/pysnmp/proto/secmod/rfc3414/priv/des.py
index c9b483a2..a9a1137c 100644
--- a/pysnmp/proto/secmod/rfc3414/priv/des.py
+++ b/pysnmp/proto/secmod/rfc3414/priv/des.py
@@ -16,8 +16,6 @@ except ImportError:
md5 = md5.new
sha1 = sha.new
-from sys import version_info
-
try:
from pysnmpcrypto import des, PysnmpCryptoError
@@ -41,10 +39,7 @@ class Des(base.AbstractEncryptionService):
SERVICE_ID = (1, 3, 6, 1, 6, 3, 10, 1, 2, 2) # usmDESPrivProtocol
KEY_SIZE = 16
- if version_info < (2, 3):
- local_int = int(random.random() * 0xffffffff)
- else:
- local_int = random.randrange(0, 0xffffffff)
+ local_int = random.randrange(0, 0xffffffff)
def hashPassphrase(self, authProtocol, privKey):
if authProtocol == hmacmd5.HmacMd5.SERVICE_ID: