mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
_make_boundary(): A minor optimization suggested by the Timbot.
This commit is contained in:
parent
616a58d79a
commit
663219a8cc
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue