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

Commit7dd5904

Browse files
committed
Revise and update rmtree docstrings and comments
1 parent0b88012 commit7dd5904

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

‎git/util.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,18 @@ def patch_env(name: str, value: str) -> Generator[None, None, None]:
170170

171171

172172
defrmtree(path:PathLike)->None:
173-
"""Remove the given recursively.
173+
"""Remove the givendirectory treerecursively.
174174
175-
:note:we use shutilrmtree but adjust its behaviour to see whether files that
176-
couldn't be deleted are read-only. Windows will not remove them in that case"""
175+
:note:We use:func:`shutil.rmtree` but adjust its behaviour to see whether files that
176+
couldn't be deleted are read-only. Windows will not remove them in that case."""
177177

178178
defhandler(function:Callable,path:PathLike,_excinfo:Any)->None:
179-
# Is the error an access error ?
179+
"""Callback for :func:`shutil.rmtree`. Works either as ``onexc`` or ``onerror``."""
180+
# Is the error an access error?
180181
os.chmod(path,stat.S_IWUSR)
181182

182183
try:
183-
function(path)# Will scream if still not possible to delete.
184+
function(path)
184185
exceptPermissionErrorasex:
185186
ifHIDE_WINDOWS_KNOWN_ERRORS:
186187
fromunittestimportSkipTest

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp