mirror of https://github.com/python/cpython
gh-38807: Fix race condition in Lib/trace.py (GH-110143)
Instead of checking if a directory does not exist and thereafter creating it, directly call os.makedirs() with the exist_ok=True.
This commit is contained in:
parent
7573c44c32
commit
78fcde039a
|
@ -265,8 +265,7 @@ class CoverageResults:
|
|||
modulename = _modname(filename)
|
||||
else:
|
||||
dir = coverdir
|
||||
if not os.path.exists(dir):
|
||||
os.makedirs(dir)
|
||||
os.makedirs(dir, exist_ok=True)
|
||||
modulename = _fullmodname(filename)
|
||||
|
||||
# If desired, get a list of the line numbers which represent
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
Fix race condition in :mod:`trace`. Instead of checking if a directory
|
||||
exists and creating it, directly call :func:`os.makedirs` with the kwarg
|
||||
``exist_ok=True``.
|
Loading…
Reference in New Issue