diff options
author | 2011-02-14 20:28:53 +0000 | |
---|---|---|
committer | 2011-02-14 20:28:53 +0000 | |
commit | 38e4024a0ea5cd6f5054725bfdda71a2e4480c8c (patch) | |
tree | 18a041f7ae14fd8d6ad4b8b114924a8cbdfac709 | |
parent | 404 for herds. (diff) | |
download | rbot-gentoo-38e4024a0ea5cd6f5054725bfdda71a2e4480c8c.tar.gz rbot-gentoo-38e4024a0ea5cd6f5054725bfdda71a2e4480c8c.tar.bz2 rbot-gentoo-38e4024a0ea5cd6f5054725bfdda71a2e4480c8c.zip |
Improve cElementTree import.
-rw-r--r-- | gentoo-scripts/herds.py | 5 | ||||
-rw-r--r-- | gentoo-scripts/maintainer.py | 5 | ||||
-rw-r--r-- | gentoo-scripts/metadata.py | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/gentoo-scripts/herds.py b/gentoo-scripts/herds.py index 8775af7..6649062 100644 --- a/gentoo-scripts/herds.py +++ b/gentoo-scripts/herds.py @@ -7,10 +7,13 @@ cache_max_age = 100 # python, pyxml import sys, string, os -import cElementTree as elementtree import urllib2 import os import time +try: + import cElementTree as etree +except ImportError: + import xml.etree.cElementTree as etree if len(sys.argv) < 2: print "usage: herds.py herdname" diff --git a/gentoo-scripts/maintainer.py b/gentoo-scripts/maintainer.py index 5e637dc..1172591 100644 --- a/gentoo-scripts/maintainer.py +++ b/gentoo-scripts/maintainer.py @@ -21,7 +21,10 @@ sys.stderr = stderr from stat import * from output import * -import cElementTree as etree +try: + import cElementTree as etree +except ImportError: + import xml.etree.cElementTree as etree nocolor() diff --git a/gentoo-scripts/metadata.py b/gentoo-scripts/metadata.py index e6785d5..8b7f974 100644 --- a/gentoo-scripts/metadata.py +++ b/gentoo-scripts/metadata.py @@ -22,7 +22,10 @@ sys.stderr = stderr from stat import * from portage.output import * -import cElementTree as etree +try: + import cElementTree as etree +except ImportError: + import xml.etree.cElementTree as etree nocolor() |