]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/util.py
- python 3.x fixes
[tld-builder.git] / TLD_Builder / util.py
index b623115d7f2e407e3fe30d69e66a97bfe4a7b32f..67bd9a1be30d230f7be2c0bdf4d9a32b4a1c3ba3 100644 (file)
@@ -11,10 +11,10 @@ def uuid_python():
 
 def uuid_external():
     f = os.popen("uuidgen 2>&1")
-    u = string.strip(f.read())
+    u = f.read().strip()
     f.close()
     if len(u) != 36:
-        raise Exception, "uuid: fatal, cannot generate uuid: %s" % u
+        raise Exception("uuid: fatal, cannot generate uuid: %s" % u)
     return u
 
 # uuid module available in python >= 2.5
@@ -52,9 +52,9 @@ def clean_tmp(dir):
 def collect_files(log, basedir = "/home"):
     f = open(log, 'r')
     rx = re.compile(r"^Wrote: (%s.*\.rpm)$" % basedir)
-    proc = re.compile(r"^Processing (files):.*$")
+    proc = re.compile(r"^Processing files:.*$")
     files = []
-    for l in reversed(list(f.xreadlines())):
+    for l in reversed(list(f)):
         if proc.match(l):
             break
         m = rx.search(l)