diff options
| author | Yannick Gingras <ygingras@ygingras.net> | 2011-01-29 16:18:17 -0500 |
|---|---|---|
| committer | Yannick Gingras <ygingras@ygingras.net> | 2011-01-29 16:18:17 -0500 |
| commit | c6d607199000a35ea007e7d41cdb765d57c357cb (patch) | |
| tree | 6cc58b342d30105a6db015fcc36f0d9d2dcf9843 /distutils2/install.py | |
| parent | ba2c20408814bec7594f9c0c9c3c9673fff7ed50 (diff) | |
| download | disutils2-c6d607199000a35ea007e7d41cdb765d57c357cb.tar.gz | |
corrected a leaked temp dir problem
Diffstat (limited to 'distutils2/install.py')
| -rw-r--r-- | distutils2/install.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/distutils2/install.py b/distutils2/install.py index e7e97d2..09f83cf 100644 --- a/distutils2/install.py +++ b/distutils2/install.py @@ -317,13 +317,13 @@ def _update_infos(infos, new_infos): def remove(project_name, paths=sys.path): """Removes a single project from the installation""" - tmp = tempfile.mkdtemp(prefix=project_name+'-uninstall') dist = get_distribution(project_name, paths=paths) if dist is None: raise DistutilsError('Distribution %s not found' % project_name) files = dist.get_installed_files(local=True) rmdirs = [] rmfiles = [] + tmp = tempfile.mkdtemp(prefix=project_name+'-uninstall') try: for file, md5, size in files: @@ -339,8 +339,8 @@ def remove(project_name, paths=sys.path): rmfiles.append(file) if dirname not in rmdirs: rmdirs.append(dirname) - except OSError: - os.rmdir(tmp) + finally: + shutil.rmtree(tmp) for file in rmfiles: os.remove(file) |
