Skip to content

Commit 05cc5df

Browse files
youknowonemiss-islington
authored andcommitted
gh-143641: Make ready_to_import always remove tempdir from sys.path (GH-143642)
Make ready_to_import always remove tempdir from sys.path (cherry picked from commit e7f5ffa) Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
1 parent d12d7a9 commit 05cc5df

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/test/support/import_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,8 +303,8 @@ def ready_to_import(name=None, source=""):
303303
try:
304304
sys.path.insert(0, tempdir)
305305
yield name, path
306-
sys.path.remove(tempdir)
307306
finally:
307+
sys.path.remove(tempdir)
308308
if old_module is not None:
309309
sys.modules[name] = old_module
310310
else:

0 commit comments

Comments
 (0)