I have some code that handles an exception, and I want to do something specific only if it\'s a specific exception, and only in debug mode. So for example:
try:
What's wrong with
try: stuff() except KeyboardInterrupt: if _debug: logging.exception("Debug handling") sys.exit() else: logging.exception("Normal handling")