diff options
author | Matthew Newhook <matthew@zeroc.com> | 2009-12-11 18:12:03 -0330 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2009-12-11 18:12:03 -0330 |
commit | 2c9aaa1ab983e4e96d1f053f2fbe4bc4b6223136 (patch) | |
tree | bfe40d049eaff8517730fc59b5499996c3f82143 /scripts/TestUtil.py | |
parent | Fix typo in cpp/test/IceGrid/admin/run.py (diff) | |
download | ice-2c9aaa1ab983e4e96d1f053f2fbe4bc4b6223136.tar.bz2 ice-2c9aaa1ab983e4e96d1f053f2fbe4bc4b6223136.tar.xz ice-2c9aaa1ab983e4e96d1f053f2fbe4bc4b6223136.zip |
fix bug with getDefaultMapping under Windows.
Diffstat (limited to 'scripts/TestUtil.py')
-rwxr-xr-x | scripts/TestUtil.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py index e896eadefa7..5ede73748ae 100755 --- a/scripts/TestUtil.py +++ b/scripts/TestUtil.py @@ -666,15 +666,12 @@ sslConfigTree["php"] = sslConfigTree["cpp"] def getDefaultMapping(): """Try and guess the language mapping out of the current path""" - - here = os.getcwd() - while len(here) > 0 and here != '/': - current = os.path.basename(here) - here = os.path.dirname(here) - if current in ["cpp", "cs", "java", "php", "py", "rb", "cppe", "javae", "tmp"]: - return current - else: - raise "cannot determine mapping" + here = os.getcwd().split(os.sep) + here.reverse() + for i in range(0, len(here)): + if here[i] in ["cpp", "cs", "java", "php", "py", "rb", "cppe", "javae", "tmp"]: + return here[i] + raise "cannot find language dir" class DriverConfig: lang = None |