diff options
author | Eli Bendersky <eliben@gmail.com> | 2012-06-15 06:03:19 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2012-06-15 06:03:19 (GMT) |
commit | 27cbb19ae562f258e64120c8ed17616719e32722 (patch) | |
tree | eb86cb9bb67e87f5134dbf0ed728cdd288ea013f /Lib/xml | |
parent | 175fada42943d627dea4ebd9527ca1d6e9b62cca (diff) | |
download | cpython-27cbb19ae562f258e64120c8ed17616719e32722.zip cpython-27cbb19ae562f258e64120c8ed17616719e32722.tar.gz cpython-27cbb19ae562f258e64120c8ed17616719e32722.tar.bz2 |
Removed _SimpleElementPath and its flaky test. The test monkey-patches the module, which causes other failures and fails itself depending on the order tests are run.
Diffstat (limited to 'Lib/xml')
-rw-r--r-- | Lib/xml/etree/ElementTree.py | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/Lib/xml/etree/ElementTree.py b/Lib/xml/etree/ElementTree.py index 4776625..d30a83c 100644 --- a/Lib/xml/etree/ElementTree.py +++ b/Lib/xml/etree/ElementTree.py @@ -101,32 +101,8 @@ import sys import re import warnings -class _SimpleElementPath: - # emulate pre-1.2 find/findtext/findall behaviour - def find(self, element, tag, namespaces=None): - for elem in element: - if elem.tag == tag: - return elem - return None - def findtext(self, element, tag, default=None, namespaces=None): - elem = self.find(element, tag) - if elem is None: - return default - return elem.text or "" - def iterfind(self, element, tag, namespaces=None): - if tag[:3] == ".//": - for elem in element.iter(tag[3:]): - yield elem - for elem in element: - if elem.tag == tag: - yield elem - def findall(self, element, tag, namespaces=None): - return list(self.iterfind(element, tag, namespaces)) +from . import ElementPath -try: - from . import ElementPath -except ImportError: - ElementPath = _SimpleElementPath() ## # Parser error. This is a subclass of <b>SyntaxError</b>. |