File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -528,9 +528,7 @@ class ElementTree:
528528 """
529529 def __init__ (self , element = None , file = None ):
530530 if element is not None and not iselement (element ):
531- raise TypeError (f"expected an xml.etree.ElementTree.Element or "
532- f"Element-like object, not "
533- f"{ type (element ).__name__ } " )
531+ raise TypeError ('expected an Element, not %s' % type (e ).__name__ )
534532 self ._root = element # first node
535533 if file :
536534 self .parse (file )
@@ -547,9 +545,7 @@ def _setroot(self, element):
547545
548546 """
549547 if not iselement (element ):
550- raise TypeError (f"expected an xml.etree.ElementTree.Element or "
551- f"Element-like object, not "
552- f"{ type (element ).__name__ } " )
548+ raise TypeError ('expected an Element, not %s' % type (e ).__name__ )
553549 self ._root = element
554550
555551 def parse (self , source , parser = None ):
You can’t perform that action at this time.
0 commit comments