Skip to content

Commit b077944

Browse files
Do not repeat the same large comment 3 times.
1 parent cfd1fd2 commit b077944

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

Lib/tempfile.py

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -213,13 +213,7 @@ def _get_default_tempdir(dirlist=None):
213213
except FileExistsError:
214214
pass
215215
except PermissionError:
216-
# On Posix, this exception is raised when the user has no
217-
# write access to the parent directory.
218-
# On Windows, it is also raised when a directory with
219-
# the chosen name already exists, or if the parent directory
220-
# is not a directory.
221-
# We cannot distinguish between "directory-exists-error" and
222-
# "access-denied-error".
216+
# See the comment in mkdtemp().
223217
if _os.name == 'nt' and _os.path.isdir(dir):
224218
continue
225219
break # no point trying more names in this directory
@@ -262,13 +256,7 @@ def _mkstemp_inner(dir, pre, suf, flags, output_type):
262256
except FileExistsError:
263257
continue # try again
264258
except PermissionError:
265-
# On Posix, this exception is raised when the user has no
266-
# write access to the parent directory.
267-
# On Windows, it is also raised when a directory with
268-
# the chosen name already exists, or if the parent directory
269-
# is not a directory.
270-
# We cannot distinguish between "directory-exists-error" and
271-
# "access-denied-error".
259+
# See the comment in mkdtemp().
272260
if _os.name == 'nt' and _os.path.isdir(dir) and seq < TMP_MAX - 1:
273261
continue
274262
else:

0 commit comments

Comments
 (0)