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

Appearance settings

Commit 7dd5904

Browse filesBrowse files
committed
Revise and update rmtree docstrings and comments
1 parent 0b88012 commit 7dd5904
Copy full SHA for 7dd5904

File tree

1 file changed

+6
-5
lines changed
Filter options

1 file changed

+6
-5
lines changed

‎git/util.py

Copy file name to clipboardExpand all lines: git/util.py
+6-5Lines 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
def rmtree(path: PathLike) -> None:
173-
"""Remove the given recursively.
173+
"""Remove the given directory tree recursively.
174174
175-
:note: we use 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"""
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
def handler(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
except PermissionError as ex:
185186
if HIDE_WINDOWS_KNOWN_ERRORS:
186187
from unittest import SkipTest

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.