Index: Lib/distutils/msvc9compiler.py =================================================================== --- Lib/distutils/msvc9compiler.py (revision 66172) +++ Lib/distutils/msvc9compiler.py (working copy) @@ -193,17 +193,6 @@ reduced_paths.append(np) return reduced_paths -def removeDuplicates(variable): - """Remove duplicate values of an environment variable. - """ - oldList = variable.split(os.pathsep) - newList = [] - for i in oldList: - if i not in newList: - newList.append(i) - newVariable = os.pathsep.join(newList) - return newVariable - def find_vcvarsall(version): """Find the vcvarsall.bat file @@ -266,9 +255,8 @@ key, value = line.split('=', 1) key = key.lower() if key in interesting: - if value.endswith(os.pathsep): - value = value[:-1] - result[key] = removeDuplicates(value) + normalized = normalize_and_reduce_paths(value.split(os.pathsep)) + result[key] = os.pathsep.join(normalized) if len(result) != len(interesting): raise ValueError(str(list(result.keys())))