# Bug report ### Bug description: This happens because `sys.path.remove(tempdir)` is placed after yield ### CPython versions tested on: CPython main branch ### Operating systems tested on: _No response_ <!-- gh-linked-prs --> ### Linked PRs * gh-143642 * gh-143647 * gh-143648 <!-- /gh-linked-prs -->