From: Alec Warner <[email protected]>

The docstring was wrong, so fix that.
If we can open the file (no EnvironmentError raised) we may still fail
to parse the file. That was previously guarded by a bare except:, so add
that back so we do not introduce any new behavior.
Fix dangling reference to myconfig; it will cause a crash.
---
 catalyst | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/catalyst b/catalyst
index 47efb90..ab69778 100755
--- a/catalyst
+++ b/catalyst
@@ -58,7 +58,7 @@ def version():
        print "Distributed under the GNU General Public License version 2.1\n"
 
 def parse_config(config_path):
-       """Parse the catalyst config file and generate a targetmap.
+       """Parse the catalyst config file and update conf_values.
 
        TODO(antarus): DANGER: This file modifies global state (conf_values).
 
@@ -91,12 +91,11 @@ def parse_config(config_path):
                # TODO(antarus): it should be discouraged to call sys.exit() 
from functions.
                # One should call sys.exit() from main()..this isn't main().
                sys.exit(1)
-
-       try:
-               myconf.update(cfg.get_values())
        except:
-               print "!!! catalyst: Unable to parse configuration file, 
"+myconfig
+               print "!!! catalyst: Unable to parse catalyst configuration: 
%s" config_path
                sys.exit(1)
+               
+       myconf.update(cfg.get_values())
 
        # now, load up the values into conf_values so that we can use them
        for x in confdefaults.keys():
-- 
1.8.1.2


Reply via email to