From 500b460c4683faeeefa6bf50afcc6a4f018b3b5d Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Thu, 18 Jul 2013 10:44:50 -0600 Subject: Look in confdir for the main config file if the initial open fails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Andreas Bießmann for the idea and an earlier version of the change. --- ConfigFile.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3