◆ __init__()
def polygraphy.util.misc.FreeOnException.__init__ |
( |
|
self, |
|
|
|
objs |
|
) |
| |
Frees the specified objects if an exception occurs in this context.
Does nothing otherwise.
Args:
objs (List[object]): List of objects with __enter__/__exit__ methods defined.
◆ __enter__()
def polygraphy.util.misc.FreeOnException.__enter__ |
( |
|
self | ) |
|
Returns the objects managed by this context manager.
◆ __exit__()
def polygraphy.util.misc.FreeOnException.__exit__ |
( |
|
self, |
|
|
|
exc_type, |
|
|
|
exc_value, |
|
|
|
traceback |
|
) |
| |
On exception, deletes all tracked objects.
Does nothing if there are no exceptions.
◆ objs
polygraphy.util.misc.FreeOnException.objs |
The documentation for this class was generated from the following file:
- Polygraphy/polygraphy/util/misc.py