Commit 3fe37189 authored by Michal Čihař's avatar Michal Čihař

Use (faster) cElementTree

parent ba978c99
...@@ -22,7 +22,7 @@ from django.utils.translation import ugettext_lazy as _ ...@@ -22,7 +22,7 @@ from django.utils.translation import ugettext_lazy as _
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.conf import settings from django.conf import settings
from django.core.cache import cache from django.core.cache import cache
from xml.etree import ElementTree from xml.etree import cElementTree
import weblate import weblate
import re import re
...@@ -738,7 +738,7 @@ class XMLTagsCheck(TargetCheck): ...@@ -738,7 +738,7 @@ class XMLTagsCheck(TargetCheck):
Wrapper for parsing XML. Wrapper for parsing XML.
''' '''
text = self.strip_entities(text.encode('utf-8')) text = self.strip_entities(text.encode('utf-8'))
return ElementTree.fromstring('<weblate>%s</weblate>' % text) return cElementTree.fromstring('<weblate>%s</weblate>' % text)
def check_single(self, source, target, flags, language, unit): def check_single(self, source, target, flags, language, unit):
# Try getting source string data from cache # Try getting source string data from cache
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment