diff --git a/src/calibre/debug.py b/src/calibre/debug.py index d56b6a55ec..c10ff44994 100644 --- a/src/calibre/debug.py +++ b/src/calibre/debug.py @@ -59,6 +59,7 @@ as a shebang in scripts, like this: help=_('Run the GUI with a debug console, logging to the' ' specified path. For internal use only, use the -g' ' option to run the GUI in debug mode')) + parser.add_option('--run-without-debug', default=False, action='store_true', help=_('Dont run python code with the DEBUG flag set')) parser.add_option('-w', '--viewer', default=False, action='store_true', help=_('Run the E-book viewer in debug mode')) parser.add_option('--paths', default=False, action='store_true', @@ -218,7 +219,8 @@ def main(args=sys.argv): sys.argv = [sys.argv[0], '--multiprocessing-fork'] exec(args[-1]) return - debug() + if not opts.run_without_debug: + debug() if opts.gui: from calibre.gui_launch import calibre calibre(['calibre'] + args[1:])