From 24f5685b15ad4cc3bbb6ba0ad2d2c8a6537c4314 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 5 Jun 1998 04:15:30 +0000 Subject: Catch configuration errors. svn path=/trunk/; revision=1903 --- fetchmailconf | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'fetchmailconf') diff --git a/fetchmailconf b/fetchmailconf index 0157e57f..a30b6d35 100755 --- a/fetchmailconf +++ b/fetchmailconf @@ -1242,21 +1242,25 @@ if __name__ == '__main__': cmd = "fetchmail -f " + rcfile + " --configdump >" + tmpfile else: cmd = "fetchmail --configdump >" + tmpfile + try: s = os.system(cmd) if s != 0: print "`" + cmd + "' run failure, status " + `s` raise SystemExit - - s = execfile(tmpfile) - if s: - print "Invalid configuration, status " + `s` - raise SystemExit except: + print "Unknown error while running fetchmail --configdump" os.remove(tmpfile) sys.exit(1) - else: + + try: + execfile(tmpfile) + except: + print "Can't read configuration output of fetchmail --configdump." os.remove(tmpfile) + sys.exit(1) + + os.remove(tmpfile) # The tricky part -- initializing objects from the configuration global # `Configuration' is the top level of the object tree we're going to mung. -- cgit v1.2.3