[Python-checkins] distutils2: fixed another leaking tempdir

tarek.ziade python-checkins at python.org
Sun Jan 30 10:45:09 CET 2011


tarek.ziade pushed 486bb332c45f to distutils2:

http://hg.python.org/distutils2/rev/486bb332c45f
changeset:   959:486bb332c45f
user:        Yannick Gingras <ygingras at ygingras.net>
date:        Sat Jan 29 18:10:22 2011 -0500
summary:
  fixed another leaking tempdir

files:
  distutils2/install.py

diff --git a/distutils2/install.py b/distutils2/install.py
--- a/distutils2/install.py
+++ b/distutils2/install.py
@@ -130,8 +130,10 @@
     :param dists: distributions to install
     :param path: base path to install distribution in
     """
+    path_is_tmp = False
     if not path:
         path = mkdtemp()
+        path_is_tmp = True
 
     installed_dists, installed_files = [], []
     for d in dists:
@@ -146,6 +148,10 @@
             for d in installed_dists:
                 uninstall(d)
             raise e
+        finally:
+            if path_is_tmp:
+                shutil.rmtree(path)
+        
     return installed_files
 
 

--
Repository URL: http://hg.python.org/distutils2


More information about the Python-checkins mailing list