[Python-checkins] r52958 - tracker/importer/sfxmlhandlers.py

erik.forsberg python-checkins at python.org
Thu Dec 7 20:18:52 CET 2006


Author: erik.forsberg
Date: Thu Dec  7 20:18:51 2006
New Revision: 52958

Modified:
   tracker/importer/sfxmlhandlers.py
Log:
Cope with what I suspect are different versions of elementtree.

Return after setting assignee to None. Resolves
http://psf.upfronthosting.co.za/roundup/meta/issue59


Modified: tracker/importer/sfxmlhandlers.py
==============================================================================
--- tracker/importer/sfxmlhandlers.py	(original)
+++ tracker/importer/sfxmlhandlers.py	Thu Dec  7 20:18:51 2006
@@ -94,7 +94,10 @@
             return self.create_user(username, realname)
 
         tree = self.loadauthorfile(authorfile)
-        table = tree.getiterator('table')[0]
+        try:
+            table = tree.getiterator('table')[0]
+        except TypeError:
+            table = tree.getiterator('table').next()
 
         alltds = table.findall('.//td')
         for i in range(len(alltds)):
@@ -114,6 +117,7 @@
         if "nobody" == username and \
                "assignee" == self.target :
             roundupdata[self.target] = None
+            return
 
         if "nobody" == username:
             username = "anonymous"


More information about the Python-checkins mailing list