mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
NamedTemporaryFile(), TemporaryFile(): removed needless local vrbl 'bin'.
This commit is contained in:
parent
bd7b4c7e46
commit
c21ea74971
1 changed files with 8 additions and 6 deletions
|
@ -396,9 +396,10 @@ def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="",
|
|||
closed.
|
||||
"""
|
||||
|
||||
bin = 'b' in mode
|
||||
if bin: flags = _bin_openflags
|
||||
else: flags = _text_openflags
|
||||
if 'b' in mode:
|
||||
flags = _bin_openflags
|
||||
else:
|
||||
flags = _text_openflags
|
||||
|
||||
# Setting O_TEMPORARY in the flags causes the OS to delete
|
||||
# the file when it is closed. This is only supported by Windows.
|
||||
|
@ -428,9 +429,10 @@ else:
|
|||
exist when it is closed.
|
||||
"""
|
||||
|
||||
bin = 'b' in mode
|
||||
if bin: flags = _bin_openflags
|
||||
else: flags = _text_openflags
|
||||
if 'b' in mode:
|
||||
flags = _bin_openflags
|
||||
else:
|
||||
flags = _text_openflags
|
||||
|
||||
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue