diff --git a/README.rst b/README.rst index e8d7ef8..96f6882 100644 --- a/README.rst +++ b/README.rst @@ -106,6 +106,16 @@ You can also enclose code with the ``with`` statement to launch ipdb if an excep Adding a context manager implies dropping Python 2.4 support. Use ``ipdb==0.6`` with 2.4. +Or you can use ``iex`` as a function decorator to launch ipdb if an exception is raised: + +.. code-block:: python + + from ipdb import iex + + @iex + def main(): + [...] + .. warning:: Using ``from future import print_function`` for Python 3 compat implies dropping Python 2.5 support. Use ``ipdb<=0.8`` with 2.5. diff --git a/tests/test_import.py b/tests/test_import.py index 5094792..7178d63 100644 --- a/tests/test_import.py +++ b/tests/test_import.py @@ -10,10 +10,11 @@ class ImportTest(unittest.TestCase): def test_import(self): - from ipdb import set_trace, post_mortem, pm, run, runcall, runeval + from ipdb import set_trace, post_mortem, pm, iex, run, runcall, runeval set_trace # please pyflakes post_mortem # please pyflakes pm # please pyflakes + iex # please pyflakes run # please pyflakes runcall # please pyflakes runeval # please pyflakes