Fixed settings=None bug when bug values file is blank/missing.
authorW. Trevor King <wking@drexel.edu>
Thu, 25 Jun 2009 12:05:43 +0000 (08:05 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 25 Jun 2009 12:05:43 +0000 (08:05 -0400)
Just return an empty dict instead.

Steps to reproduce:

  $ mkdir /tmp/BE-test
  $ cd /tmp/BE-test
  $ be set-root
  $ be new 'having too much fun'

libbe/mapfile.py

index c36d4545f8707fe5397148474cbe836ba6a61f67..027289053392dbfe889b1ec18136d24be9a27711 100644 (file)
@@ -113,7 +113,7 @@ def parse(contents):
             else:
                 newlines.append(line)
         contents = '\n'.join(newlines)
-    return yaml.load(contents)
+    return yaml.load(contents) or {}
 
 def map_save(rcs, path, map, allow_no_rcs=False):
     """Save the map as a mapfile to the specified path"""