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-2.0.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

ipdbugger-2.0.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for ipdbugger-2.0.0.tar.gz
Algorithm Hash digest
SHA256 466d8f8723b344bc65af18fc6656fd9f2ccdef7b2c32bda2a2a2249fa424a06b
MD5 9d8a3ee75e10342111c824f1654e5655
BLAKE2b-256 fe6b11cc9b5d294d501973659d271256fb03684e8ca5b9754da44e691827b450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ipdbugger-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0ac19e918608f039f54381c2a6c0270c3ce52b1b04467b3d7eae0ede645cca25
MD5 eb7247c6c416b219e085b1f7bb6c299e
BLAKE2b-256 93aa0d7becbaf812004856a4a6d7208934ce4281dab44b26320b809a29dfcbc8

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