diff options
author | cookedm <cookedm@localhost> | 2007-05-28 17:49:55 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2007-05-28 17:49:55 +0000 |
commit | 60eed2d138f5fd08fc8fa016debbac097371a47d (patch) | |
tree | a14274bdd33e90ee1fa84c9ccc94fe2d522846ac /numpy/distutils/fcompiler/ibm.py | |
parent | bfb1633766b1e6b1c72de094aa565c6e6ec0db80 (diff) | |
download | numpy-60eed2d138f5fd08fc8fa016debbac097371a47d.tar.gz |
Better temporary file handling by using one temporary directory for
numpy.distutils, and removing that at exit. Replaces using tempfile.mktemp.
Diffstat (limited to 'numpy/distutils/fcompiler/ibm.py')
-rw-r--r-- | numpy/distutils/fcompiler/ibm.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py index 4694ad73f..cf1ee1a8d 100644 --- a/numpy/distutils/fcompiler/ibm.py +++ b/numpy/distutils/fcompiler/ibm.py @@ -4,6 +4,7 @@ import sys from numpy.distutils.fcompiler import FCompiler from numpy.distutils.exec_command import exec_command, find_executable +from numpy.distutils.misc_util import make_temp_file from distutils import log compilers = ['IBMFCompiler'] @@ -65,15 +66,13 @@ class IBMFCompiler(FCompiler): opt.append('-bshared') version = self.get_version(ok_status=[0,40]) if version is not None: - import tempfile if sys.platform.startswith('aix'): xlf_cfg = '/etc/xlf.cfg' else: xlf_cfg = '/etc/opt/ibmcmp/xlf/%s/xlf.cfg' % version - new_cfg = tempfile.mktemp()+'_xlf.cfg' + fo, new_cfg = make_temp_file(suffix='_xlf.cfg') log.info('Creating '+new_cfg) fi = open(xlf_cfg,'r') - fo = open(new_cfg,'w') crt1_match = re.compile(r'\s*crt\s*[=]\s*(?P<path>.*)/crt1.o').match for line in fi.readlines(): m = crt1_match(line) |