diff options
Diffstat (limited to 'src/engine/SCons/Tool/PharLapCommon.py')
-rw-r--r-- | src/engine/SCons/Tool/PharLapCommon.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/engine/SCons/Tool/PharLapCommon.py b/src/engine/SCons/Tool/PharLapCommon.py index 2cfb02a..64dd02f 100644 --- a/src/engine/SCons/Tool/PharLapCommon.py +++ b/src/engine/SCons/Tool/PharLapCommon.py @@ -29,14 +29,13 @@ Phar Lap ETS tool chain. Right now, this is linkloc and # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 4720 2010/03/24 03:14:11 jars" +__revision__ = "src/engine/SCons/Tool/PharLapCommon.py 5023 2010/06/14 22:05:46 scons" import os import os.path import SCons.Errors import SCons.Util import re -import string def getPharLapPath(): """Reads the registry to find the installed path of the Phar Lap ETS @@ -46,7 +45,7 @@ def getPharLapPath(): be found.""" if not SCons.Util.can_read_reg: - raise SCons.Errors.InternalError, "No Windows registry module was found" + raise SCons.Errors.InternalError("No Windows registry module was found") try: k=SCons.Util.RegOpenKeyEx(SCons.Util.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Pharlap\\ETS') @@ -62,7 +61,7 @@ def getPharLapPath(): return os.path.normpath(val) except SCons.Util.RegError: - raise SCons.Errors.UserError, "Cannot find Phar Lap ETS path in the registry. Is it installed properly?" + raise SCons.Errors.UserError("Cannot find Phar Lap ETS path in the registry. Is it installed properly?") REGEX_ETS_VER = re.compile(r'#define\s+ETS_VER\s+([0-9]+)') @@ -79,7 +78,7 @@ def getPharLapVersion(): include_path = os.path.join(getPharLapPath(), os.path.normpath("include/embkern.h")) if not os.path.exists(include_path): - raise SCons.Errors.UserError, "Cannot find embkern.h in ETS include directory.\nIs Phar Lap ETS installed properly?" + raise SCons.Errors.UserError("Cannot find embkern.h in ETS include directory.\nIs Phar Lap ETS installed properly?") mo = REGEX_ETS_VER.search(open(include_path, 'r').read()) if mo: return int(mo.group(1)) @@ -97,14 +96,14 @@ def addPathIfNotExists(env_dict, key, path, sep=os.pathsep): is_list = 1 paths = env_dict[key] if not SCons.Util.is_List(env_dict[key]): - paths = string.split(paths, sep) + paths = paths.split(sep) is_list = 0 - if not os.path.normcase(path) in map(os.path.normcase, paths): + if os.path.normcase(path) not in list(map(os.path.normcase, paths)): paths = [ path ] + paths if is_list: env_dict[key] = paths else: - env_dict[key] = string.join(paths, sep) + env_dict[key] = sep.join(paths) except KeyError: env_dict[key] = path |