_make_boundary(): A minor optimization suggested by the Timbot.

This commit is contained in:
Barry Warsaw 2003-06-24 20:19:34 +00:00
parent 616a58d79a
commit 663219a8cc
1 changed files with 1 additions and 1 deletions

View 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