*Gnarf* Sorry, I messed up tabs and white spaces in the patch. Attached is a corrected version that should be usable directly.
Hauke -- .''`. Jan Hauke Rahm <j...@debian.org> www.jhr-online.de : :' : Debian Developer www.debian.org `. `'` Member of the Linux Foundation www.linux.com `- Fellow of the Free Software Foundation Europe www.fsfe.org
From 588ebedc0f601c900e53695394b3a9d5d59d5818 Mon Sep 17 00:00:00 2001 From: Jan Hauke Rahm <j...@debian.org> Date: Thu, 7 Apr 2011 15:15:57 +0200 Subject: [PATCH] Fail gently if config section is missing If config has chosen a default_host that doesn't exist, i.e. by misspelling it, fail more gently than with an uncaught exception. --- dput | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dput b/dput index 1916eca..c184911 100755 --- a/dput +++ b/dput @@ -304,8 +304,12 @@ def verify_files(path, filename, host, check_only, check_version, sys.exit(1) # Run the check to verify that the package has been tested. - if config.getboolean(host, 'check_version') == 1 or check_version: - version_check (path, changes, debug) + try: + if config.getboolean(host, 'check_version') == 1 or check_version: + version_check (path, changes, debug) + except ConfigParser.NoSectionError, e: + print >> sys.stderr, "Error in config file:\n%s" % str(e) + sys.exit(1) # Verify the signature of the maintainer verify_signature(host, change_file, dsc_file, check_only, debug,\ -- 1.7.4.1
signature.asc
Description: Digital signature