Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2dca689

Browse files
[3.11]gh-38807: Fix race condition in Lib/trace.py (GH-110143) (GH-114207)
Instead of checking if a directory does not exist and thereaftercreating it, directly call os.makedirs() with the exist_ok=True.(cherry picked from commit78fcde0)Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
1 parent2b03259 commit2dca689

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎Lib/trace.py‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,7 @@ def write_results(self, show_missing=True, summary=False, coverdir=None):
258258
modulename=_modname(filename)
259259
else:
260260
dir=coverdir
261-
ifnotos.path.exists(dir):
262-
os.makedirs(dir)
261+
os.makedirs(dir,exist_ok=True)
263262
modulename=_fullmodname(filename)
264263

265264
# If desired, get a list of the line numbers which represent
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix race condition in:mod:`trace`. Instead of checking if a directory
2+
exists and creating it, directly call:func:`os.makedirs` with the kwarg
3+
``exist_ok=True``.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp