Skip to main content

ipdb-based debugger

Project description

PyPI Python versions https://travis-ci.org/gregoil/ipdbugger.svg?branch=master https://coveralls.io/repos/github/gregoil/ipdbugger/badge.svg?branch=master

ipdbugger is a code debugging tool based on ipdb.

Use the debug decorator on functions or classes to debug them. What actually happens: it surrounds each statement of the functions with a try-except, and starts an ipdb session in the exception handling section.

Installing

$ pip install ipdbugger

Using

from ipdbugger import debug

@debug
def f():
    foo = 1 + 1
    bar = 1 / 0
    baz = 2 + 2

Now when you run f(), you’ll get into an ipdb shell right after the error (the division by zero):

>>> from ipdbugger import debug
>>> @debug
    def f():
        foo = 1 + 1
        bar = 1 / 0
        baz = 2 + 2

>>> f()
Traceback (most recent call last):
   File "<ipython-input-2-5720bb02ab1d>", line 4, in f
    bar = 1 / 0
 ZeroDivisionError: integer division or modulo by zero
> <ipython-input-2-5720bb02ab1d>(5)f()
      2 def f():
      3     foo = 1 + 1
      4     bar = 1 / 0
----> 5     baz = 2 + 2
      6

ipdb> foo
2
ipdb>

From there, you have a couple of choices:

  • retry the action

  • continue with the rest of the flow (and ignore the error)

  • raise the exception, as if you didn’t catch it at all

  • Use any other of the available ipdb commands, like jump

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipdbugger-2.3.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

ipdbugger-2.3.0-py2.py3-none-any.whl (7.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ipdbugger-2.3.0.tar.gz.

File metadata

  • Download URL: ipdbugger-2.3.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for ipdbugger-2.3.0.tar.gz
Algorithm Hash digest
SHA256 57e107196262d3c686d8ad004df01f44bc9582749a6978f79c02e22d8599da4e
MD5 84a4d77dab5b9e867b9667bafdbe6a0c
BLAKE2b-256 7341e3596f07cb9741b08261691c0629caaf36c12a58e3178594066d82a9ffd5

See more details on using hashes here.

File details

Details for the file ipdbugger-2.3.0-py2.py3-none-any.whl.

File metadata

  • Download URL: ipdbugger-2.3.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.3

File hashes

Hashes for ipdbugger-2.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 87bdcf38442e90bfca1c03780dd6143ef51941452de0af9f93b917db79f6dcd1
MD5 cd6186d73556ea8f04a6bb10a404e87f
BLAKE2b-256 5604cdb71ce5203563380922e598c42cf68be028c9db6a553a94bc7fccf56893

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page