diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2004-03-30 17:52:29 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2004-03-30 17:52:29 +0000 |
commit | d838c7960309a819ddd62cbf775bf171a08c5809 (patch) | |
tree | 2d27da99ab4ff838c30f110fc478a3f42c33102f /scipy_distutils/exec_command.py | |
parent | bea45934772282d176b7e494fbbce118171630dd (diff) | |
download | numpy-d838c7960309a819ddd62cbf775bf171a08c5809.tar.gz |
Using os.path.realpath only on posix platforms.
Diffstat (limited to 'scipy_distutils/exec_command.py')
-rw-r--r-- | scipy_distutils/exec_command.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scipy_distutils/exec_command.py b/scipy_distutils/exec_command.py index c55f47068..1d83f5b9e 100644 --- a/scipy_distutils/exec_command.py +++ b/scipy_distutils/exec_command.py @@ -120,6 +120,10 @@ def find_executable(exe, path=None): log.debug('find_executable(%r)' % exe) if path is None: path = os.environ.get('PATH',os.defpath) + if os.name=='posix': + realpath = os.path.realpath + else: + realpath = lambda a:a suffices = [''] if os.name in ['nt','dos','os2']: @@ -144,11 +148,11 @@ def find_executable(exe, path=None): for path in paths: fn = os.path.join(path,exe) for s in suffices: - f_ext = os.path.realpath(fn+s) + f_ext = realpath(fn+s) if os.path.isfile(f_ext) and os.access(f_ext,os.X_OK): log.debug('Found executable %s' % f_ext) return f_ext - exe = os.path.realpath(exe) + exe = realpath(exe) if not os.path.isfile(exe) or os.access(exe,os.X_OK): log.warn('Could not locate executable %s' % exe) return exe |