Skip to main content

ipdb-based debugger

Project description

https://travis-ci.org/gregoil/ipdbugger.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-1.1.3.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

ipdbugger-1.1.3-py2.py3-none-any.whl (6.4 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ipdbugger-1.1.3.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ipdbugger-1.1.3.tar.gz
Algorithm Hash digest
SHA256 2d62989118a82d8cbfe7ed23379a7f8b90c6911f92c6d32e1192bdb6a543776c
MD5 be03b29a5bcf955de8becadb8cf76861
BLAKE2b-256 1a80323cbbb62aba062e2830b0505e0ea4efe324e5b4e5a235631c38ceabb0cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ipdbugger-1.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 53a588485be3c472d799ec227118a44065c881699fe3fc495f09d9e634afcae5
MD5 291b7f22b60a2b02387c1b574f0a28c9
BLAKE2b-256 f11a47761eccea3e65ad00bc8bff804ccabab52f50e5cbc320b508ccf3535b0d

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