summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Iversen <teh.ivo@gmail.com>2016-03-11 01:50:42 +1100
committerMatt Iversen <teh.ivo@gmail.com>2016-03-11 01:50:42 +1100
commit15fdd1f0bc13042e43e3c6f921d80c10f87a90d5 (patch)
treef15c07a456dc0edf1c617226d0d11c9a5df639eb
parentd665675c25d6711c98f16f43a3fbf76875a297fe (diff)
parent1c2a334ae397eb172864634511f36898ef2ab1b9 (diff)
downloadvirtualenv-15fdd1f0bc13042e43e3c6f921d80c10f87a90d5.tar.gz
Merge pull request #882 from rkuska/develop
Print error message when DEST_DIR exists and is a file
-rwxr-xr-xvirtualenv.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/virtualenv.py b/virtualenv.py
index 80ed640..c3739a6 100755
--- a/virtualenv.py
+++ b/virtualenv.py
@@ -677,6 +677,11 @@ def main():
home_dir = args[0]
+ if os.path.exists(home_dir) and os.path.isfile(home_dir):
+ logger.fatal('ERROR: File already exists and is not a directory.')
+ logger.fatal('Please provide a different path or delete the file.')
+ sys.exit(3)
+
if os.environ.get('WORKING_ENV'):
logger.fatal('ERROR: you cannot run virtualenv while in a workingenv')
logger.fatal('Please deactivate your workingenv, then re-run this script')