mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:38:53 +07:00
PY-29471 Properly delete temp directory created by means of tempdir module
Previously in case of error pip run with runpy.run_module() terminated the execution of the script abruptly with SystemExit and this cleanup wasn't performed. Normally it didn't happen though, since temp directory was created on Java side in PyPackageManagerImpl.install() that was responsible for its removal.
This commit is contained in:
@@ -143,11 +143,12 @@ def main():
|
||||
rmdir = mkdtemp_ifneeded()
|
||||
|
||||
pkgs = sys.argv[2:]
|
||||
do_install(pkgs)
|
||||
|
||||
if rmdir is not None:
|
||||
import shutil
|
||||
shutil.rmtree(rmdir)
|
||||
try:
|
||||
do_install(pkgs)
|
||||
finally:
|
||||
if rmdir is not None:
|
||||
import shutil
|
||||
shutil.rmtree(rmdir)
|
||||
|
||||
elif cmd == 'untar':
|
||||
if len(sys.argv) < 2:
|
||||
|
||||
Reference in New Issue
Block a user