From b012d252975d36d17a2368bd0ee79088a2407bb0 Mon Sep 17 00:00:00 2001 From: zuber Date: Thu, 15 Oct 2009 19:09:15 +0200 Subject: [PATCH] Changed xml.py module name to etree.py because it was conflicting with xml package in python std. Require elementtree or lxml because they have proper namespace handling. --- cas_provider/{xml.py => etree.py} | 16 ++++------------ cas_provider/models.py | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) rename cas_provider/{xml.py => etree.py} (64%) diff --git a/cas_provider/xml.py b/cas_provider/etree.py similarity index 64% rename from cas_provider/xml.py rename to cas_provider/etree.py index da56a97..eb6f0be 100644 --- a/cas_provider/xml.py +++ b/cas_provider/etree.py @@ -14,19 +14,11 @@ try: except ImportError: try: - # Python 2.5 - import xml.etree.cElementTree as etree + # normal cElementTree install + import 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: - # normal ElementTree install - import elementtree.ElementTree as etree + # normal ElementTree install + import elementtree.ElementTree as etree try: register_namespace = ET.register_namespace diff --git a/cas_provider/models.py b/cas_provider/models.py index eae9cf6..5d09912 100644 --- a/cas_provider/models.py +++ b/cas_provider/models.py @@ -3,7 +3,7 @@ from django.contrib.auth.models import User from django.conf import settings from django.core.urlresolvers import get_callable -from cas_provider.xml import etree, register_namespace, ElementRoot +from cas_provider.etree import etree, register_namespace, ElementRoot class ServiceTicket(models.Model): user = models.ForeignKey(User) -- 2.20.1