Merge branch 'kurtmckee/fix-patch-stop-order-i...'
This commit is contained in:
commit
82834e66ca
1 changed files with 3 additions and 1 deletions
|
@ -217,7 +217,9 @@ def root(standardize_tmp):
|
||||||
try:
|
try:
|
||||||
yield current_root
|
yield current_root
|
||||||
finally:
|
finally:
|
||||||
[patch.stop() for patch in patches]
|
# Patches must be stopped in reverse order because some patches are nested.
|
||||||
|
# Stopping in the reverse order restores the original function.
|
||||||
|
[patch.stop() for patch in reversed(patches)]
|
||||||
os.chdir(current_working_directory)
|
os.chdir(current_working_directory)
|
||||||
if sys.version_info >= (3, 12):
|
if sys.version_info >= (3, 12):
|
||||||
rmtree(current_root, onexc=rmtree_error_handler)
|
rmtree(current_root, onexc=rmtree_error_handler)
|
||||||
|
|
Loading…
Reference in a new issue