diff options
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 |