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

This commit is contained in:
Jeong, YunWon authored and Jeong, YunWon committed 2026-01-18 20:00:14 +09:00
1 parent 005014a3f9
commit 3836958eaa
1 file changed
+1 -1
+1 -1
View File
@@ -305,8 +305,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: