summaryrefslogtreecommitdiff
path: root/virtualenv.py
diff options
context:
space:
mode:
authorRobert Kuska <rkuska@redhat.com>2016-03-10 11:09:49 +0100
committerRobert Kuska <rkuska@redhat.com>2016-03-10 11:09:49 +0100
commit1c2a334ae397eb172864634511f36898ef2ab1b9 (patch)
treef15c07a456dc0edf1c617226d0d11c9a5df639eb /virtualenv.py
parentd665675c25d6711c98f16f43a3fbf76875a297fe (diff)
downloadvirtualenv-1c2a334ae397eb172864634511f36898ef2ab1b9.tar.gz
Print error message when DEST_DIR exists and is a file
Diffstat (limited to 'virtualenv.py')
-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')