_make_boundary(): A minor optimization suggested by the Timbot.
This commit is contained in:
parent
616a58d79a
commit
663219a8cc
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue