aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bugdir.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/bugdir.py')
-rw-r--r--libbe/bugdir.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 5738a80..9ab8d69 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -440,7 +440,7 @@ class BugDir (list, settings_object.SavedSettingsObject):
"""
if type(xml_string) == str:
xml_string = xml_string.strip().encode('unicode_escape')
- if hasattr(xml_string, 'getchildren'): # already an ElementTree Element
+ if isinstance(xml_string, ElementTree.Element):
bugdir = xml_string
else:
bugdir = ElementTree.XML(xml_string)
@@ -452,7 +452,7 @@ class BugDir (list, settings_object.SavedSettingsObject):
self.explicit_attrs = []
uuid = None
estrs = []
- for child in bugdir.getchildren():
+ for child in bugdir:
if child.tag == 'short-name':
pass
elif child.tag == 'bug':
@@ -461,18 +461,18 @@ class BugDir (list, settings_object.SavedSettingsObject):
self.append(bg, update=True)
continue
elif child.tag in tags:
- if child.text == None or len(child.text) == 0:
+ if child.text is None or len(child.text) == 0:
text = settings_object.EMPTY
elif child.tag in ['severities', 'active-status',
'inactive-status']:
entries = []
- for entry in child.getchildren():
+ for entry in child:
if entry.tag != 'entry':
raise utility.InvalidXML(
'{} child element {} must be <entry>'.format(
child.tag, entry))
key = value = None
- for kv in entry.getchildren():
+ for kv in entry:
if kv.tag == 'key':
if key is not None:
raise utility.InvalidXML(
@@ -718,7 +718,7 @@ class RevisionedBugDir (BugDir):
self.revision = revision
def changed(self):
return self.storage.changed()
-
+
if libbe.TESTING == True:
class SimpleBugDir (BugDir):
@@ -728,7 +728,7 @@ if libbe.TESTING == True:
>>> bugdir = SimpleBugDir()
>>> uuids = list(bugdir.uuids())
>>> uuids.sort()
- >>> print uuids
+ >>> print(uuids)
['a', 'b']
>>> bugdir.cleanup()
"""