[Zope3-checkins] CVS: Zope3/src/zope/app/services/pluggableauth - __init__.py:1.1.2.2

Chris McDonough chrism@zope.com
Sun, 22 Jun 2003 12:09:59 -0400


Update of /cvs-repository/Zope3/src/zope/app/services/pluggableauth
In directory cvs.zope.org:/tmp/cvs-serv11586

Modified Files:
      Tag: pluggable_authentication_service-branch
	__init__.py 
Log Message:
Import generators from future for use under 2.2.

Fix gen_key function to yield values that are convertable to int.


=== Zope3/src/zope/app/services/pluggableauth/__init__.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/services/pluggableauth/__init__.py:1.1.2.1	Tue Jun  3 09:34:06 2003
+++ Zope3/src/zope/app/services/pluggableauth/__init__.py	Sun Jun 22 12:09:58 2003
@@ -16,6 +16,7 @@
 $Id$
 """
 
+from __future__ import generators
 import random
 import sys
 import datetime
@@ -45,7 +46,7 @@
 def gen_key():
     """Return a random int (1, MAXINT), suitable for use as a BTree key."""
 
-    return random.randint(0,sys.maxint)
+    return random.randint(0,sys.maxint-1)
 
 class PluggableAuthenticationService(OrderedContainer):