Commit 7e5206a9 authored by Tim Peters's avatar Tim Peters

NamedTemporaryFile(), TemporaryFile(): removed needless local vrbl 'bin'.

parent 55b1592d
...@@ -396,9 +396,10 @@ def NamedTemporaryFile(mode='w+b', bufsize=-1, suffix="", ...@@ -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: ...@@ -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:
......
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