ets-labs / python-dependency-injector

Dependency injection framework for Python
https://python-dependency-injector.ets-labs.org/
BSD 3-Clause "New" or "Revised" License
3.86k stars 303 forks source link

Close the resources in case there was an exception #769

Open ivanovart opened 10 months ago

ivanovart commented 10 months ago

I have the same problem as in https://github.com/ets-labs/python-dependency-injector/issues/681: the resources are not closed in case functions are failing, and I have my exceptions handler on a higher level then functions I inject. So I suggest the change to close the dependencies in any case.