Fixes #9944 73c978d replaced a move with a copy, which cased rmdir to fail (as it expects an empty directory). This switches to use `shutil.rmtree` instead.
73c978d