Changeset 792 in tailor


Ignore:
Timestamp:
09/09/05 00:05:53 (8 years ago)
Author:
lele@…
Hash name:
20050908220553-97f81-d387eb4ca435a882ae47df032597d553d688e9c9
Message:

Under win32 try also .bat and .exe for external tools

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vcpx/repository.py

    r790 r792  
    9696 
    9797        if self.EXECUTABLE: 
    98             from os import getenv 
     98            from os import getenv, pathsep 
    9999            from os.path import isabs, exists, join 
    100100            from vcpx.config import ConfigurationError 
     101            from sys import platform 
    101102 
    102103            if isabs(self.EXECUTABLE): 
     
    104105            else: 
    105106                ok = False 
    106                 for path in getenv('PATH').split(':'): 
     107                mswindows = (platform == "win32") 
     108                for path in getenv('PATH').split(pathsep): 
    107109                    if exists(join(path, self.EXECUTABLE)): 
    108110                        ok = True 
     111                    elif mswindows: 
     112                        for ext in ['.exe', '.bat']: 
     113                            if exists(join(path, self.EXECUTABLE + ext)): 
     114                                self.EXECUTABLE += ext 
     115                                ok = True 
     116                                break 
     117                    if ok: 
    109118                        break 
    110119            if not ok: 
Note: See TracChangeset for help on using the changeset viewer.