Skip to content

Commit 31cd7fb

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 bf3ed37 commit 31cd7fb

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
@@ -305,8 +305,8 @@ def ready_to_import(name=None, source=""):
305305
try:
306306
sys.path.insert(0, tempdir)
307307
yield name, path
308-
sys.path.remove(tempdir)
309308
finally:
309+
sys.path.remove(tempdir)
310310
if old_module is not None:
311311
sys.modules[name] = old_module
312312
else:

0 commit comments

Comments
 (0)