]> granicus.if.org Git - python/commitdiff
_make_boundary(): A minor optimization suggested by the Timbot.
authorBarry Warsaw <barry@python.org>
Tue, 24 Jun 2003 20:19:34 +0000 (20:19 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 24 Jun 2003 20:19:34 +0000 (20:19 +0000)
Lib/email/Generator.py

index 6f17963d0f18fc1895cc7cf0f41b080137c73488..3e578a2f745b6a57c9ff9a9e75c51ca4b251290e 100644 (file)
@@ -363,7 +363,7 @@ _fmt = '%%0%dd' % _width
 def _make_boundary(text=None):
     # Craft a random boundary.  If text is given, ensure that the chosen
     # boundary doesn't appear in the text.
-    token = random.randint(0, sys.maxint-1)
+    token = random.randrange(sys.maxint)
     boundary = ('=' * 15) + (_fmt % token) + '=='
     if text is None:
         return boundary