Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #95284

Re: Hooking Mechanism when Entering and Leaving a Try Block

References <55CA6D7F.1060705@mail.de>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2015-08-12 09:32 -0600
Subject Re: Hooking Mechanism when Entering and Leaving a Try Block
Newsgroups comp.lang.python
Message-ID <mailman.111.1439393598.3627.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Aug 11, 2015 at 3:47 PM, Sven R. Kunze <srkunze@mail.de> wrote:
> is there something like a hook that a Python module could register to in
> order to 'trace' the entering and leaving of arbitrary try blocks?

Not that I'm aware of.

However, it sounds like context managers might do what you want. You
would just need to instrument your try blocks by adding with blocks.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Hooking Mechanism when Entering and Leaving a Try Block Ian Kelly <ian.g.kelly@gmail.com> - 2015-08-12 09:32 -0600

csiph-web