Permalink
Browse files

This is getting a bit hairy, but try to import ElementTree from lxml …

…as well.

git-svn-id: https://pysolr.googlecode.com/svn/trunk@14 13ae9d4a-4d43-0410-997b-81b7443f7ec1
  • Loading branch information...
1 parent e641a92 commit ff3f1b25edfac4d1b610b9882d7aa602e1783d79 @jkocherhans committed Mar 28, 2008
Showing with 10 additions and 3 deletions.
  1. +10 −3 pysolr.py
View
@@ -111,10 +111,17 @@
from xml.etree import cElementTree as ET
except ImportError:
try:
- # use cElementTree if available
- import cElementTree as ET
+ # use etree from lxml if it is installed
+ from lxml.etree import ElementTree as ET
except ImportError:
- from elementtree import ElementTree as ET
+ try:
+ # use cElementTree if available
+ import cElementTree as ET
+ except ImportError:
+ try:
+ from elementtree import ElementTree as ET
+ except ImportError:
+ raise ImportError("No suitable ElementTree implementation was found.")
__all__ = ['Solr']

0 comments on commit ff3f1b2

Please sign in to comment.