]> rtime.felk.cvut.cz Git - linux-conf-perf.git/commitdiff
Fix fromfolder script
authorKarel Kočí <cynerd@email.cz>
Sat, 12 Sep 2015 09:23:42 +0000 (11:23 +0200)
committerKarel Kočí <cynerd@email.cz>
Sat, 12 Sep 2015 09:23:42 +0000 (11:23 +0200)
Script ended with exception when no file with list of non-remove
configuration options was provided.

scripts/fromfolder.py

index d5bb2b3a94c78846c0dcfe8df87e915c4b6f8b17..8d67cce03dcb5ee063cb167100958e9180d86047 100755 (executable)
@@ -48,11 +48,14 @@ if __name__ == '__main__':
                exceptfile = sys.argv[4]
 
        exceptconf = set()
-       if os.path.isfile(exceptfile):
-               for ln in open(exceptfile):
-                       lns = ln.rstrip()
-                       if lns:
-                               exceptconf.add(lns)
+       try:
+               if os.path.isfile(exceptfile):
+                       for ln in open(exceptfile):
+                               lns = ln.rstrip()
+                               if lns:
+                                       exceptconf.add(lns)
+       except NameError:
+               pass
 
        rem = loadfromfolder(sf(conf.linux_sources + '/' + folder))