From fa3feddf3a25e34db2ac57ff8e962f13db07bf40 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Mon, 25 May 2020 19:33:47 -0400 Subject: Untested conversion to support Python 3 --- cryptech/py11/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cryptech/py11/__init__.py') diff --git a/cryptech/py11/__init__.py b/cryptech/py11/__init__.py index 1618a76..740ecb6 100644 --- a/cryptech/py11/__init__.py +++ b/cryptech/py11/__init__.py @@ -125,7 +125,7 @@ class PKCS11 (object): self.d.C_GetSlotList(CK_TRUE, None, byref(count)) slots = (CK_SLOT_ID * count.value)() self.d.C_GetSlotList(CK_TRUE, slots, byref(count)) - return tuple(slots[i] for i in xrange(count.value)) + return tuple(slots[i] for i in range(count.value)) def C_GetTokenInfo(self, slot_id): token_info = CK_TOKEN_INFO() @@ -169,7 +169,7 @@ class PKCS11 (object): count = CK_ULONG(1) while count.value > 0: self.d.C_FindObjects(session, objects, len(objects), byref(count)) - for i in xrange(count.value): + for i in range(count.value): yield objects[i] def FindObjects(self, session, template = None, **kwargs): -- cgit v1.2.3