Fixed bug in TVRage API that was effecting python 2.6 users

This commit is contained in:
echel0n 2014-03-29 01:22:08 -07:00
parent c309e8afc9
commit f0ffae31a6

View file

@ -410,7 +410,7 @@ class TVRage:
# remove it to avoid errors. Change from SickBeard, from will14m # remove it to avoid errors. Change from SickBeard, from will14m
xml = ElementTree.fromstring(src.rstrip("\r")) xml = ElementTree.fromstring(src.rstrip("\r"))
tree = ElementTree.ElementTree(xml) tree = ElementTree.ElementTree(xml)
for elm in tree.iter(): for elm in tree.findall('.//*'):
elm.tag = robj.sub(lambda m: reDict[m.group(0)], elm.tag) elm.tag = robj.sub(lambda m: reDict[m.group(0)], elm.tag)
if elm.tag in 'firstaired': if elm.tag in 'firstaired':
@ -428,7 +428,7 @@ class TVRage:
try: try:
xml = ElementTree.fromstring(src.rstrip("\r")) xml = ElementTree.fromstring(src.rstrip("\r"))
tree = ElementTree.ElementTree(xml) tree = ElementTree.ElementTree(xml)
for elm in tree.iter(): for elm in tree.findall('.//*'):
elm.tag = robj.sub(lambda m: reDict[m.group(0)], elm.tag) elm.tag = robj.sub(lambda m: reDict[m.group(0)], elm.tag)
if elm.tag in 'firstaired' and elm.text: if elm.tag in 'firstaired' and elm.text: