Changeset 2106


Ignore:
Timestamp:
11/26/10 11:21:01 (3 years ago)
Author:
wehart
Message:

Add logic to gracefully terminate when a user does not have
permissions needed to create the target directory.

Resolving #93.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pyutilib.virtualenv/trunk/scripts/vpy_install

    r2105 r2106  
    27402740    print "WARNING: ignoring the value of the PYTHONHOME environment variable!  This value can corrupt the virtual python installation." 
    27412741 
    2742  
    27432742# 
    27442743# The following taken from PyUtilib 
     
    39663965install_pip.use_default=True 
    39673966 
     3967 
     3968# 
     3969# This is a monkey patch, to catch errors when a directory cannot be created 
     3970# by virtualenv. 
     3971# 
     3972def mkdir(path): 
     3973    if not os.path.exists(path): 
     3974        logger.info('Creating %s', path) 
     3975        try: 
     3976            os.makedirs(path) 
     3977        except Exception, e: 
     3978            print "Cannot create directory '%s'!" % path 
     3979            print "Verify that you have write permissions to this directory." 
     3980            sys.exit(1) 
     3981    else: 
     3982        logger.info('Directory %s already exists', path) 
    39683983 
    39693984# 
Note: See TracChangeset for help on using the changeset viewer.