From aed6938d2271c1538e6ce6a8737095e6dddc9ac9 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 22 Jun 2011 14:19:50 -0400 Subject: [PATCH] now fails correctly if --settings is given but file does not exist --- configParser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/configParser.py b/configParser.py index 01e6a14..7a9adaa 100644 --- a/configParser.py +++ b/configParser.py @@ -81,6 +81,10 @@ class ConfigOptionParser(object): if os.path.exists(self.configFile): execfile(self.configFile, g, l) + elif options.config_file: + # file does not exist, but *was* specified on the command line + logging.error("Could not open %s." % self.configFile) + sys.exit(1) except NameError, ex: import traceback traceback.print_exc()