summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicha? G?rny <mgorny@gentoo.org>2013-08-05 00:21:36 +0200
committerMicha? G?rny <mgorny@gentoo.org>2013-08-05 00:21:36 +0200
commit71d4dce635d2f8a1fa02165b85cc0ed7af23f264 (patch)
treebfeb790e136726648152a441f82431fd26bd5a76
parent408e327e39d1484e613de2f9fd21ddb5e2fc7821 (diff)
downloadpython-setuptools-bitbucket-71d4dce635d2f8a1fa02165b85cc0ed7af23f264.tar.gz
Unlink destination file before writing scripts.
-rwxr-xr-xsetuptools/command/easy_install.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 3194644e..dd1e3b25 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -799,6 +799,8 @@ Please make the appropriate changes for your system and try again.
mask = current_umask()
if not self.dry_run:
ensure_directory(target)
+ if os.path.exists(target):
+ os.unlink(target)
f = open(target,"w"+mode)
f.write(contents)
f.close()