Permalink
Browse files

minor code cleanup

  • Loading branch information...
1 parent cbfedcd commit 541128d66160471d22342b47402b0a4be088e9cb @scoder scoder committed Mar 29, 2013
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/lxml/apihelpers.pxi
View
@@ -575,15 +575,11 @@ cdef list _collectAttributes(xmlNode* c_node, int collecttype):
c_attr = c_attr.next
return attributes
-cdef object __RE_XML_ENCODING
-__RE_XML_ENCODING = re.compile(
+cdef object __RE_XML_ENCODING = re.compile(
ur'^(<\?xml[^>]+)\s+encoding\s*=\s*["\'][^"\']*["\'](\s*\?>|)', re.U)
-cdef object __REPLACE_XML_ENCODING
-__REPLACE_XML_ENCODING = __RE_XML_ENCODING.sub
-
-cdef object __HAS_XML_ENCODING
-__HAS_XML_ENCODING = __RE_XML_ENCODING.match
+cdef object __REPLACE_XML_ENCODING = __RE_XML_ENCODING.sub
+cdef object __HAS_XML_ENCODING = __RE_XML_ENCODING.match
cdef object _stripEncodingDeclaration(object xml_string):
# this is a hack to remove the XML encoding declaration from unicode

0 comments on commit 541128d

Please sign in to comment.