Closed musicinmybrain closed 1 year ago
it might be nice to simply define a small wrapper around rmtree
i wonder if there is a inexpensive backport
Is something like https://github.com/ofek/hatch-vcs/pull/53 what you were thinking of?
I didn’t address the line-by-line feedback in this PR (waiting to see if the approach in https://github.com/ofek/hatch-vcs/pull/53 is preferred or not), but I did cherry-pick @ofek’s suggested change to the version check from that PR.
Superseded by https://github.com/ofek/hatch-vcs/pull/53
The replacement is
shutil.rmtree(onexc=…)
, which receives the exception instead of the sys.exc_info() tuple as the third argument.Unfortunately, explicitly testing the Python version number seems to be required. See also https://github.com/pypa/pip/pull/12137.
Fixes a
DeprecationWarning
likewhen running the tests on Python 3.12.