From 50120e88b680c3b20c6ee9b924366de00ada5466 Mon Sep 17 00:00:00 2001 From: calvin Date: Sun, 18 Dec 2005 09:13:34 +0000 Subject: [PATCH] check for -O option which disables debugging git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2989 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkchecker | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/linkchecker b/linkchecker index 2f0dcbc2..838048d4 100755 --- a/linkchecker +++ b/linkchecker @@ -42,6 +42,7 @@ import linkcheck.checker import linkcheck.checker.cache import linkcheck.checker.consumer import linkcheck.configuration +import linkcheck.fileutil import linkcheck.strformat # optional modules has_optcomplete = linkcheck.fileutil.has_module("optcomplete") @@ -490,8 +491,8 @@ if options.trace: options.psyco = False config.init_logging(debug=options.debug) -linkcheck.log.debug(linkcheck.LOG_CMDLINE, _("Python %s on %s"), - sys.version, sys.platform) +assert linkcheck.log.debug(linkcheck.LOG_CMDLINE, _("Python %s on %s"), + sys.version, sys.platform) # read configuration files try: files = [] @@ -505,6 +506,10 @@ try: except linkcheck.LinkCheckerError, msg: # config error print_usage(str(msg)) +# test if running with -O +if options.debug and not __debug__: + linkcheck.log.warn(linkcheck.LOG_CMDLINE, + _("Running with python -O disables debugging.")) # apply commandline options and arguments constructauth = False do_profile = False @@ -630,7 +635,7 @@ if constructauth: 'user': _username, 'password': _password}) -linkcheck.log.debug(linkcheck.LOG_CMDLINE, "configuration: %s", +assert linkcheck.log.debug(linkcheck.LOG_CMDLINE, "configuration: %s", pprint.pformat(config.items())) # warn about sitemap loggers and verbose output klasses = [c.__class__ for c in [config['logger']] + config['fileoutput']]