1- import _base
2- import new
1+ from . import _base
32import warnings
4- from html5lib .constants import DataLossWarning
5- import etree as etree_builders
6- from html5lib import ihatexml
3+ from . .constants import DataLossWarning
4+ from . import etree as etree_builders
5+ from .. import ihatexml
76
87try :
98 import lxml .etree as etree
@@ -158,7 +157,7 @@ class Attributes(dict):
158157 def __init__ (self , element , value = {}):
159158 self ._element = element
160159 dict .__init__ (self , value )
161- for k , v in self .iteritems ():
160+ for k , v in self .items ():
162161 self ._element ._element .attrib [filter .coerceAttribute (k )] = v
163162
164163 def __setitem__ (self , key , value ):
@@ -263,7 +262,7 @@ def insertRoot(self, token):
263262 """Create the document root"""
264263 #Because of the way libxml2 works, it doesn't seem to be possible to
265264 #alter information like the doctype after the tree has been parsed.
266- #Therefore we need to use the built-in parser to create our iniial
265+ #Therefore we need to use the built-in parser to create our initial
267266 #tree, after which we can add elements like normal
268267 docStr = ""
269268 if self .doctype and self .doctype .name :
@@ -278,7 +277,7 @@ def insertRoot(self, token):
278277 try :
279278 root = etree .fromstring (docStr )
280279 except etree .XMLSyntaxError :
281- print docStr
280+ print ( docStr )
282281 raise
283282
284283 #Append the initial comments:
0 commit comments