[svn] r5997 - trunk/tools/mrepo

packagers at lists.rpmforge.net packagers at lists.rpmforge.net
Fri Nov 16 15:23:01 CET 2007


Author: dag
Date: 2007-11-16 15:23:00 +0100 (Fri, 16 Nov 2007)
New Revision: 5997

Modified:
   trunk/tools/mrepo/ChangeLog
   trunk/tools/mrepo/youget
Log:
Fix elementtree for python 2.5 and higher (Leo Eraly)

Modified: trunk/tools/mrepo/ChangeLog
===================================================================
--- trunk/tools/mrepo/ChangeLog	2007-11-16 14:12:14 UTC (rev 5996)
+++ trunk/tools/mrepo/ChangeLog	2007-11-16 14:23:00 UTC (rev 5997)
@@ -21,6 +21,7 @@
 - Added unit tests (Alexander Bergolth)
 - Added youget tool to download packages from Yast Online Update
 - Added new OES1 and OES2 dist configs (Nicole Hähnel)
+- Fix elementtree for python 2.5 and higher (Leo Eraly)
 
 * 0.8.4 - Sint-Jacobsplein - released 13/12/2006
 - Renamed Yam to mrepo (Matthew Hannigan)

Modified: trunk/tools/mrepo/youget
===================================================================
--- trunk/tools/mrepo/youget	2007-11-16 14:12:14 UTC (rev 5996)
+++ trunk/tools/mrepo/youget	2007-11-16 14:23:00 UTC (rev 5997)
@@ -21,14 +21,21 @@
 import signal, xmlrpclib, getpass, glob, fnmatch, urllib2
 import gzip
 
+### Python 2.5 and higher
 try:
-    import cElementTree as ElementTree
+    import xml.etree.ElementTree as ElementTree
 except:
+    ### Bummer, but cElementTree is considerably faster than ElementTree
     try:
-        import ElementTree
+        import cElementTree as ElementTree
     except:
-        print >>sys.stderr, 'Error loading python module ElementTree, please install.'
-        sys.exit(1)
+        ### Then, hopefully this works ?
+        try:
+            import ElementTree
+        except:
+            ### No, it did not
+            print >>sys.stderr, 'Error loading python module ElementTree, please install.'
+            sys.exit(1)
 
 __version__ = "$Revision: 4786 $"
 # $Source$




More information about the commits mailing list