Kaydet (Commit) 663219a8 authored tarafından Barry Warsaw's avatar Barry Warsaw

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

üst 616a58d7
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment