diff options
author | Robert Kuska <rkuska@redhat.com> | 2016-03-10 11:09:49 +0100 |
---|---|---|
committer | Robert Kuska <rkuska@redhat.com> | 2016-03-10 11:09:49 +0100 |
commit | 1c2a334ae397eb172864634511f36898ef2ab1b9 (patch) | |
tree | f15c07a456dc0edf1c617226d0d11c9a5df639eb /virtualenv.py | |
parent | d665675c25d6711c98f16f43a3fbf76875a297fe (diff) | |
download | virtualenv-1c2a334ae397eb172864634511f36898ef2ab1b9.tar.gz |
Print error message when DEST_DIR exists and is a file
Diffstat (limited to 'virtualenv.py')
-rwxr-xr-x | virtualenv.py | 5 |
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') |