mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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.
|
closed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bin = 'b' in mode
|
if 'b' in mode:
|
||||||
if bin: flags = _bin_openflags
|
flags = _bin_openflags
|
||||||
else: flags = _text_openflags
|
else:
|
||||||
|
flags = _text_openflags
|
||||||
|
|
||||||
# Setting O_TEMPORARY in the flags causes the OS to delete
|
# Setting O_TEMPORARY in the flags causes the OS to delete
|
||||||
# the file when it is closed. This is only supported by Windows.
|
# the file when it is closed. This is only supported by Windows.
|
||||||
|
@ -428,9 +429,10 @@ else:
|
||||||
exist when it is closed.
|
exist when it is closed.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
bin = 'b' in mode
|
if 'b' in mode:
|
||||||
if bin: flags = _bin_openflags
|
flags = _bin_openflags
|
||||||
else: flags = _text_openflags
|
else:
|
||||||
|
flags = _text_openflags
|
||||||
|
|
||||||
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
|
(fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue