We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97d5fa0 commit c3fb864Copy full SHA for c3fb864
Lib/xml/etree/ElementTree.py
@@ -528,7 +528,8 @@ class ElementTree:
528
"""
529
def __init__(self, element=None, file=None):
530
if element is not None and not iselement(element):
531
- raise TypeError('expected an Element, not %s' % type(e).__name__)
+ raise TypeError('expected an Element, not %s' %
532
+ type(element).__name__)
533
self._root = element # first node
534
if file:
535
self.parse(file)
@@ -545,7 +546,8 @@ def _setroot(self, element):
545
546
547
548
if not iselement(element):
549
+ raise TypeError('expected an Element, not %s'
550
+ % type(element).__name__)
551
self._root = element
552
553
def parse(self, source, parser=None):
0 commit comments