How to use the pudb.post_mortem function in pudb

To help you get started, we’ve selected a few pudb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zulip / zulip-terminal / zulipterminal / cli / run.py View on Github external
print(in_color('red', "\nPossible theme error: {}.".format(e)))
        # Acts as separator between logs
        logging.info("\n\n" + str(e) + "\n\n")
        logging.exception(e)
        sys.exit(1)
    except Exception as e:
        logging.info("\n\n" + str(e) + "\n\n")
        logging.exception(e)
        if args.debug:
            sys.stdout.flush()
            traceback.print_exc(file=sys.stderr)
            run_debugger = input("Run Debugger? (y/n): ")
            if run_debugger in ["y", "Y", "yes"]:
                # Open PUDB Debuuger
                import pudb
                pudb.post_mortem()

        if hasattr(e, 'extra_info'):
            print("\n" + in_color("red", e.extra_info),    # type: ignore
                  file=sys.stderr)

        print(in_color("red", "\nZulip Terminal has crashed!"
                       "\nPlease refer to " + LOG_FILENAME + " for full log of"
                       " the error."), file=sys.stderr)
        print("You can ask for help at:", file=sys.stderr)
        print("https://chat.zulip.org/#narrow/stream/206-zulip-terminal",
              file=sys.stderr)
        print("\nThanks for using the Zulip-Terminal interface.\n")
        sys.stderr.flush()

    finally:
        if args.profile:
github jedie / django-phpBB3 / django_phpBB3 / management / commands / phpbb2djangobb.py View on Github external
def handle(self, *args, **options):
        try:
            self._handle(*args, **options)
        except Exception:
            print "-"*TERMINAL_WIDTH
            traceback.print_exc()
            print "-"*TERMINAL_WIDTH
            debugger.post_mortem()
github UFAL-DSG / tgen / tgen / debug.py View on Github external
# we are in interactive mode, we don't have a tty-like
        # device,, or the user triggered a KeyboardInterrupt,
        # so we call the default hook
        sys.__excepthook__(exc_type, value, tb)
    else:
        import traceback
        # import ipdb
        import pudb
        # we are NOT in interactive mode, print the exception
        traceback.print_exception(exc_type, value, tb)
        print()
        input("Press any key to start debugging...")
        # then start the debugger in post-mortem mode.
        # pdb.pm() # deprecated
        # ipdb.post_mortem(tb)  # more modern
        pudb.post_mortem(tb)
github XinnuoXu / CVAE_Dial / debug / helper.py View on Github external
# we are in interactive mode, we don't have a tty-like
        # device,, or the user triggered a KeyboardInterrupt,
        # so we call the default hook
        sys.__excepthook__(exc_type, value, tb)
    else:
        import traceback
        # import ipdb
        import pudb
        # we are NOT in interactive mode, print the exception
        traceback.print_exception(exc_type, value, tb)
        print
        input("Press any key to start debugging...")
        # then start the debugger in post-mortem mode.
        # pdb.pm() # deprecated
        # ipdb.post_mortem(tb)  # more modern
        pudb.post_mortem(tb)