From 5c64b499c2cf6f168970aa7ae51fe4997cdd89fc Mon Sep 17 00:00:00 2001 From: Ilya Etingof Date: Sun, 10 Feb 2019 18:30:59 +0100 Subject: Officially remove Python < 2.6 support (#239) Perhaps previous commits have already broken older Python support. This commit mostly declares Python 2.6+ support. --- pysnmp/proto/rfc1902.py | 1 - pysnmp/proto/secmod/rfc3414/priv/des.py | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'pysnmp/proto') 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 # 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: -- cgit v1.2.1