Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
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...
commit ff3f1b25edfac4d1b610b9882d7aa602e1783d79 1 parent e641a92
@jkocherhans authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 pysolr.py
View
13 pysolr.py
@@ -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']
Please sign in to comment.
Something went wrong with that request. Please try again.