Make ready_to_import always remove tempdir from sys.path (#6687)

This commit is contained in:
Jeong, YunWon authored and GitHub committed 2026-01-10 16:32:26 +09:00
1 parent 0cd6eb7b13
commit e835ce9275
1 file changed
+1 -1
+1 -1
View File
@@ -303,8 +303,8 @@ def ready_to_import(name=None, source=""):
try:
sys.path.insert(0, tempdir)
yield name, path
sys.path.remove(tempdir)
finally:
sys.path.remove(tempdir)
if old_module is not None:
sys.modules[name] = old_module
else: