[brightcove] fix on Python 2.6
This commit is contained in:
parent
df50a41289
commit
5de3ece225
2 changed files with 5 additions and 5 deletions
|
@ -201,8 +201,8 @@ else:
|
|||
if sys.version_info >= (2,7):
|
||||
def find_xpath_attr(node, xpath, key, val):
|
||||
""" Find the xpath xpath[@key=val] """
|
||||
assert re.match(r'^[a-z]+$', key)
|
||||
assert re.match(r'^[a-z]*$', val)
|
||||
assert re.match(r'^[a-zA-Z]+$', key)
|
||||
assert re.match(r'^[a-zA-Z@]*$', val)
|
||||
expr = xpath + u"[@%s='%s']" % (key, val)
|
||||
return node.find(expr)
|
||||
else:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue