diff options
author | Jonathan Corbet <corbet@lwn.net> | 2013-07-18 10:44:50 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2013-07-18 10:44:50 -0600 |
commit | 500b460c4683faeeefa6bf50afcc6a4f018b3b5d (patch) | |
tree | dc819bbe87ffac649e7d6dabe6e3f3f734fe035e | |
parent | dd45a96f0a035d10cc12973e9931df3c9d95a781 (diff) |
Look in confdir for the main config file if the initial open fails
Thanks to Andreas Bießmann <andreas.biessmann@corscience.de> for the idea
and an earlier version of the change.
-rw-r--r-- | ConfigFile.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ConfigFile.py b/ConfigFile.py index 0a942f4..3a1e208 100644 --- a/ConfigFile.py +++ b/ConfigFile.py @@ -167,7 +167,10 @@ def ConfigFile (name, confdir): try: file = open (name, 'r') except IOError: - croak ('Unable to open config file %s' % (name)) + try: + file = open (os.path.join (confdir, name), 'r') + except IOError: + croak ('Unable to open config file %s' % (name)) line = ReadConfigLine (file) while line: sline = line.split (None, 2) |