summaryrefslogtreecommitdiff
path: root/scripts/TestUtil.py
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2009-11-23 13:28:08 +0100
committerBenoit Foucher <benoit@zeroc.com>2009-11-23 13:28:08 +0100
commit2c578015edcb36cdc0acd0227295de1dcca1b995 (patch)
treee163980b5dabb43a40089a29fdf8ff47a3e07f1c /scripts/TestUtil.py
parentno longer generating inspect method for each Ruby exception (diff)
downloadice-2c578015edcb36cdc0acd0227295de1dcca1b995.tar.bz2
ice-2c578015edcb36cdc0acd0227295de1dcca1b995.tar.xz
ice-2c578015edcb36cdc0acd0227295de1dcca1b995.zip
New AMI mapping
Diffstat (limited to 'scripts/TestUtil.py')
-rwxr-xr-xscripts/TestUtil.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/scripts/TestUtil.py b/scripts/TestUtil.py
index d98d1876378..378e366d017 100755
--- a/scripts/TestUtil.py
+++ b/scripts/TestUtil.py
@@ -673,7 +673,7 @@ def getDefaultMapping():
"""Try and guess the language mapping out of the current path"""
here = os.getcwd()
- while len(here) > 0:
+ 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"]:
@@ -1277,11 +1277,15 @@ class PhpCleanup:
os.remove("tmp.ini")
# TODO: Perhaps this should be done when the tmp.ini file is created.
-lang = getDefaultMapping()
-if getDefaultMapping() == "php":
- # Instantiate a PhpCleanup object. The __del__ method will
- # cleanup when the scritp is done.
- p = PhpCleanup()
+try:
+ lang = getDefaultMapping()
+ if getDefaultMapping() == "php":
+ # Instantiate a PhpCleanup object. The __del__ method will
+ # cleanup when the scritp is done.
+ p = PhpCleanup()
+except:
+ # Can't figure default mapping, so it's not PHP
+ pass
def processCmdLine():
def usage():