Changeset 3791 for TI12-security/trunk


Ignore:
Timestamp:
17/04/08 14:09:13 (12 years ago)
Author:
pjkersha
Message:

Fix for writing distutils config file if distutils is not present - write to other standard location ~/.pydistutils.cfg instead.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI12-security/trunk/python/ndg-security-install.py

    r3201 r3791  
    239239            configParser.set('build_ext', 'library_dirs', opensslLibPath) 
    240240             
    241         configParser.write(open(distutilsCfgFilePath, 'w')) 
     241        try: 
     242            configParser.write(open(distutilsCfgFilePath, 'w')) 
     243        except IOError: 
     244            # distutils dir may not be installed - try local dir as back-up 
     245            # option 
     246            distutilsCfgFilePath = os.path.join(os.environ['HOME'], 
     247                                                '.pydistutils.cfg') 
     248            configParser.write(open(distutilsCfgFilePath, 'w')) 
    242249     
    243250     
Note: See TracChangeset for help on using the changeset viewer.