SOURCES: kernel-config.py - catch lines where no value is set

glen glen at pld-linux.org
Sat Mar 1 13:53:18 CET 2008


Author: glen                         Date: Sat Mar  1 12:53:18 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- catch lines where no value is set

---- Files affected:
SOURCES:
   kernel-config.py (1.14 -> 1.15) 

---- Diffs:

================================================================
Index: SOURCES/kernel-config.py
diff -u SOURCES/kernel-config.py:1.14 SOURCES/kernel-config.py:1.15
--- SOURCES/kernel-config.py:1.14	Tue Feb  5 17:46:52 2008
+++ SOURCES/kernel-config.py	Sat Mar  1 13:53:13 2008
@@ -113,8 +113,13 @@
     hash = {}
     for item in c[1:]:
         try:
-            (key, value) = item.split('=')
-            hash[key] = value
+            try:
+                (key, value) = item.split('=')
+                hash[key] = value
+            except ValueError:
+                print "Invalid line: %s" % l.strip()
+                err = 1
+                continue
         except IndexError:
             print "Invalid line: %s" % l.strip()
             err = 1
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/kernel-config.py?r1=1.14&r2=1.15&f=u



More information about the pld-cvs-commit mailing list