summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnas Nashif <nashif@linux.intel.com>2011-04-07 23:16:00 +0100
committerAnas Nashif <nashif@linux.intel.com>2011-04-07 23:16:00 +0100
commitccc8d8d834d98b60888e160c8756f401ba8d940f (patch)
treeb1de5ae3aaa8704e85fc8b2d9edb9a351846ab52
parenta215d709781247b586e04f8c279823be8a95cdc7 (diff)
downloadkickstarter-ccc8d8d834d98b60888e160c8756f401ba8d940f.tar.gz
kickstarter-ccc8d8d834d98b60888e160c8756f401ba8d940f.tar.bz2
kickstarter-ccc8d8d834d98b60888e160c8756f401ba8d940f.zip
try xml parser alternatives
-rwxr-xr-xtools/kickstarter22
1 files changed, 20 insertions, 2 deletions
diff --git a/tools/kickstarter b/tools/kickstarter
index 47a523c..befae7e 100755
--- a/tools/kickstarter
+++ b/tools/kickstarter
@@ -10,8 +10,26 @@ import time
import optparse
from time import gmtime, strftime
import errno
-#import elementtree.ElementTree as etree
-from lxml import etree
+try:
+ from lxml import etree
+except ImportError:
+ try:
+ # Python 2.5
+ import xml.etree.cElementTree as etree
+ except ImportError:
+ try:
+ # Python 2.5
+ import xml.etree.ElementTree as etree
+ except ImportError:
+ try:
+ # normal cElementTree install
+ import cElementTree as etree
+ except ImportError:
+ try:
+ # normal ElementTree install
+ import elementtree.ElementTree as etree
+ except ImportError:
+ print("Failed to import ElementTree from any known place")
def mkdir_p(path):
try: