mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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):
|
def _make_boundary(text=None):
|
||||||
# Craft a random boundary. If text is given, ensure that the chosen
|
# Craft a random boundary. If text is given, ensure that the chosen
|
||||||
# boundary doesn't appear in the text.
|
# boundary doesn't appear in the text.
|
||||||
token = random.randint(0, sys.maxint-1)
|
token = random.randrange(sys.maxint)
|
||||||
boundary = ('=' * 15) + (_fmt % token) + '=='
|
boundary = ('=' * 15) + (_fmt % token) + '=='
|
||||||
if text is None:
|
if text is None:
|
||||||
return boundary
|
return boundary
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue