mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
Fix case where wc_info is not present.
Reapply r80770 "Switch from xml.dom.minidom to xml.etree". TBR=dpranke@chromium.org BUG= TEST= git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@80785 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
@@ -14,8 +14,6 @@ import subprocess
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
import xml.dom.minidom
|
||||
import xml.parsers.expat
|
||||
|
||||
|
||||
def hack_subprocess():
|
||||
@@ -114,29 +112,6 @@ def SplitUrlRevision(url):
|
||||
return tuple(components)
|
||||
|
||||
|
||||
def ParseXML(output):
|
||||
try:
|
||||
return xml.dom.minidom.parseString(output)
|
||||
except xml.parsers.expat.ExpatError:
|
||||
return None
|
||||
|
||||
|
||||
def GetNamedNodeText(node, node_name):
|
||||
child_nodes = node.getElementsByTagName(node_name)
|
||||
if not child_nodes:
|
||||
return None
|
||||
assert len(child_nodes) == 1 and child_nodes[0].childNodes.length == 1
|
||||
return child_nodes[0].firstChild.nodeValue
|
||||
|
||||
|
||||
def GetNodeNamedAttributeText(node, node_name, attribute_name):
|
||||
child_nodes = node.getElementsByTagName(node_name)
|
||||
if not child_nodes:
|
||||
return None
|
||||
assert len(child_nodes) == 1
|
||||
return child_nodes[0].getAttribute(attribute_name)
|
||||
|
||||
|
||||
def SyntaxErrorToError(filename, e):
|
||||
"""Raises a gclient_utils.Error exception with the human readable message"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user